Open jjSDET opened 1 year ago
➤ Daniela Arcese commented:
Let’s investigate what is happening here and propose possible solutions.
@jjSDET it's been while since this bug was reported. Is it still reproducible?
I can reproduce the issue described in the bug report, but debugging is difficult with only the testing environment. I would like to set up a mock database for testing purposes.
Additionally, I reviewed the history panel code, but I'm unclear on how fetching and prefetching work. There is a queryFetchLimit parameter, which is currently set to 100. Changing this to 50 makes the no2 work correctly.
In my tests, setting the limit to 10 results in only one item being fetched, even though I have 10 items in the history. Increasing the limit to 20 still fetches only one item. It only works as expected when the limit is set to a higher value.
➤ Razvan Litianu commented:
Norberto Andres Furlan
During performance testing of the History List, I ran into a number of issues with how the history items are displayed.
I found six use cases where the dated history items weren't handled correctly and displayed in their correct date bucket.
Testing was difficult so I extended our current tool,
./test-fixtures/generate-test-db.py
that modifies our Simulator dbs to also add dated history items totoday
,yesterday
,a week
,a month
, andolder
for use with testing this bug.The History List, unlike the
Bookmarks List
, throttles the max element loading to 100 items when you visit the page. This requires scrolling through the items before they will populate the various date buckets, and this delayed processing resulted in a number of issues.Steps to reproduce
Modify a performance test to run a test with your own db. For example, I created a new test ‘testHistoryDatabaseFixtureJJ’, and added a breakpoint on the assertion verifying the element count. Then I modify the ‘fixtures’ array with my db i’ll be using for testing mapping my new test to the test db used when running the test, name it anything you’d like: Then I ran the script in ‘./test-fixtures’, ‘generate-test-db.py’, passing in the arguments i wanted to test. You can also run it without arguments to be prompted for what you need. For example, from the root directory of Client you can use
python3 ./test-fixtures/generate-test-db.py -history 500 -bookmarks 0 -today -yesterday -week -month -older -db_name jj-places -bundle_identifier org.mozilla.ios.FennecEnterprise
You can add or remove any of the date buckets if you just wanted to test, let’s say, ‘week’ and ‘older’, none of them are required, though the script will default to ‘today’ if no date bucket is specified.PLEASE NOTE: the database connection sometimes doesn’t release because of weirdness with iOS Simulator. I couldn’t figure out a 100% way to address that; HOWEVER! If you make sure you finish running the test until it fails, then closing the simulator and reopening the simulator before your next test run, it seems to work 95% of the time.
What I did was change the assertion TIME_OUT to 3 seconds, then continued the test by clicking the ‘play/continue program execution’ button on the debugger console. Note the change on line 69 to 3 seconds timeout. The ‘continue program execution button’ is the one to the right of the blue flag symbol on the bottom left.
Expected behavior
The dated history entries should populate in the correct date buckets.
Actual behavior
Only the first 100 are listed in the earliest date bucket with entries and the rest don't populate correctly when scrolling through the entries as they load.
Device & build information
Notes
Attachments:
┆Issue is synchronized with this Jira Spike