qutebrowser/tests/unit
Ryan Roden-Corrent 6151b43c47 Fix qute_history benchmark.
This benchmark was running very quickly due to an improper setup.
The current history implementation expects that a newly inserted entry must
be more recent than any existing entries and sorts according to this
assumption.

The benchmark test inserts increasingly older entries, breaking this invariant.
When run in the benchmark, the qute://history/data implementation would
see an entry older than the oldest time in the time window and would
immediately return with a single "next" entry.

This patch inserts data in an order that mantains history's invariant and adds
a sanity-check at the end of the test. It does not check for the exact length
as not all entries will be within the time window. The length will be some
values <= 100000, the check just ensures that there is at least something more
than a "next" entry.

Before:
---------------------------------------------- benchmark: 1 tests ----------------------------------------------
Name (time in us)                  Min      Max    Mean  StdDev  Median     IQR  Outliers(*)  Rounds  Iterations
----------------------------------------------------------------------------------------------------------------
test_qute_history_benchmark     9.3050  21.9250  9.6143  0.2454  9.5880  0.1070      230;360    9930           1
----------------------------------------------------------------------------------------------------------------

After:
-------------------------------------------------- benchmark: 1 tests -------------------------------------------------
Name (time in ms)                    Min       Max      Mean  StdDev    Median     IQR  Outliers(*)  Rounds  Iterations
-----------------------------------------------------------------------------------------------------------------------
test_qute_history_benchmark     220.7040  223.1900  221.7536  1.1070  221.1939  1.8803          1;0       5           1
-----------------------------------------------------------------------------------------------------------------------
2017-04-17 12:15:49 -04:00
..
browser Fix qute_history benchmark. 2017-04-17 12:15:49 -04:00
commands Add automatic backend selection in earlyinit 2017-02-05 17:09:04 +01:00
completion Adjustments for new pylint version 2017-04-13 18:22:16 +02:00
config Release v0.10.1 2017-03-08 06:26:22 +01:00
javascript show webview when caret testing 2016-09-29 09:26:58 +02:00
keyinput Use three-argument form of monkeypatch.*attr 2017-03-01 11:33:41 +01:00
mainwindow Improve messageview hide code 2017-03-26 15:03:44 +02:00
misc Stabilize test_guiprocess 2017-03-31 13:05:34 +02:00
scripts Use three-argument form of monkeypatch.*attr 2017-03-01 11:33:41 +01:00
utils Redirect qute:foo to qute://foo 2017-04-06 21:18:58 +02:00
test_app.py Fix lint 2016-05-24 21:53:50 +02:00