Open
Bug 2095794
Opened 6 days ago
Updated 4 days ago
[meta] Fix the mochitest-plain tests that fail when run twice in a row
Categories
(Testing :: General, task)
Testing
General
Tracking
(Not tracked)
ASSIGNED
People
(Reporter: florian, Assigned: florian)
References
(Depends on 1 open bug)
Details
(Keywords: meta)
Attachments
(1 external file)
Running every mochitest-plain test twice in the same browser session exposed tests, test servers and a few product behaviours that leave state behind or assume a cold first run. The patches below fix those repeat failures.
Test fixes
test_bug375314.html(bug 2094404) - The content policy was unregistered in a timer that never fired once the harness navigated away, so the second registration threw. The test now unregisters before finishing.test_link_prefetch.html(bug 2094409) - The second run's prefetch was served from the HTTP cache and never reached the server.referrer_testserver.sjsnow sendsCache-Control: no-cacheon recorded loads.test_wheel_zoom_on_form_controls.html(bug 2094418) - Ctrl+wheel zooms the top-level browsing context, but the test only reset its iframe's zoom, so the zoom kept shrinking. It now resets the top-level zoom.test_midi_packet_timing_sorting.html(bug 2094421) - The test assumed the first packet's timestamp is positive, but a quick second run makes it negative. The check now starts from-Infinity.test_beaconOriginHeader.html(bug 2094425) -beacon-originheader-handler.sjskept a finished XHR response in object state, which the next run's beacon answered instead of the new query. The state is now cleared.test_image_cache_notification.html(bug 1923050) - The cache entry left by the first run was already notified, and notifications are once per entry by design. The test now clears the image cache first.test_net_failedtoprocess.html(bug 2094427) - The erroredinvalid.jpgstayed in the image cache, so the second run never decoded it and timed out. The test now clears the image cache afterwards.test_font_loading_api.html(bug 2094702) - Fixed font URLs were served from the user font cache on the second run, makingload()synchronous. The URLs are now unique per page load.test_speech_synthesis.html(bug 2094711) - The voice registry keeps its voices for the process lifetime, so the second run saw them immediately and waited forvoiceschangedforever. The test no longer waits when voices are loaded.test_bug1747033.html(bug 1868598) - The test never finished the multipart response it started when going back, so the next run's request consumed it. The test now finishes that response.test_bug1699721.html(bug 2094724) - On the second run the page came from the HTTP cache, so the awaitedhttp-on-examine-responsenever fired. The test now also observeshttp-on-examine-cached-response, and its skip is removed.test_warning_for_blocked_cross_site_request.html(bug 2094726) - On reload the CSS images weren't requested again, so their CORS warnings never came. Those styles are now set from script with per-load URLs.test_error_events_abort_transactions.html(bug 1316680) - The iframe left its IndexedDB database behind, so the second run's firstopen()succeeded instead of upgrading. The iframe now deletes it.test_event_propagation.html(bug 2094729) - The iframe left its IndexedDB database at version 1, so the second run got noupgradeneededand timed out. It now deletes the database before finishing.test_bug836922_npolicies.html(bug 2094731) - The report-only SJS reset stored"null", which made the next run's report handler throw. The reset now clears the state.test_bug910139.html(bug 2095706) -file_bug910139.sjschose its CSP with a server-side counter that persisted across runs. It now uses the query string, and the skips are removed.test_img_referrer.html(bug 1883461) - A cached image loaded synchronously beforereferrerPolicywas set. The test now clears the image cache first, and its skip is removed.test_beaconFrame.html(bug 2095713) -beacon-handler.sjsleft{}for consumed beacons, so a second-rungetBeaconwas answered with undefined data. It now deletes them, and the skip is removed.test_import_with_cache.html(bug 2095714) - The SJS's "already sent" state outlived the first run, so everyaddModule()got a 404. The state is now keyed per run, and the skip is removed.test_bug1170484.html(bug 1844234) - The helper assumed the context menu was already open, which only held while its load was slow. It now waits for the menu to be shown.test_event_target_radius.html(bug 2095777) - The cross-origin iframe was only shown at the next refresh tick, which a warm load could beat. The test now flushes layout before loading it.test_1331680_xhr.html(bug 2095739) -document.cookiecan't delete the HttpOnlyxhr2cookie, so the second run got nocookie-changedand timed out. The cookie is now removed from chrome.test_subresources_prompts.html(bug 2095740) - Cached HTTP credentials from the first run meant no prompt opened on the second. The test now clears the HTTP auth cache.test_cachemiss.html(bug 2095778) - Completions stored incache.sjsserver state came back in the second run's negative-cache case. They are now cleared inreset(), and the skip is removed.
Product fixes
test_worker_UnwrapArg.html(bug 2077709) - The harness's own navigations count againstdom.navigation.navigationRateLimit, and repeated runs hit the limit so a test's load was dropped.TestRunner.jsnow resets it before each test, and the per-manifest overrides are removed.test_bug413958.html(bug 2095781) - The shared style sheet cache hands out sheets without parsing them, so no CSS errors are reported on the repeat run. The cache is no longer used in documents that report CSS errors.test_performance_timeline.html(bug 1113676) - An image reused from the image cache by another document produced no resource timing entry, unlike stylesheets and scripts.imgLoadernow adds one.
| Assignee | ||
Comment 1•6 days ago
|
||
Like the standalone variant: on backstop pushes, on Linux and Windows only, to
spare the mac pool.
You need to log in
before you can comment on or make changes to this bug.
Description
•