Open Bug 1861535 Opened 2 years ago Updated 1 month ago

Intermittent browser/base/content/test/contextMenu/browser_strip_on_share_link.js | single tracking bug

Categories

(Core :: Privacy: Anti-Tracking, defect, P5)

defect

Tracking

()

REOPENED

People

(Reporter: intermittent-bug-filer, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: intermittent-failure, intermittent-testcase, priv-triaged)

Filed by: nbeleuzu [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=433953954&repo=mozilla-beta
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/cExdKSwXR4SV87SJebO8UA/runs/0/artifacts/public/logs/live_backing.log


[task 2023-10-26T22:44:10.995Z] 22:44:10     INFO - TEST-PASS | browser/base/content/test/contextMenu/browser_strip_on_share_link.js | Menu item is visible - true == true - 
[task 2023-10-26T22:44:10.996Z] 22:44:10     INFO - Initializing clipboard with "waitForClipboard-known-value-0.39384636037720155"...
[task 2023-10-26T22:44:10.997Z] 22:44:10     INFO - Succeeded initializing clipboard, start requested things...
[task 2023-10-26T22:44:10.998Z] 22:44:10     INFO - Buffered messages finished
[task 2023-10-26T22:44:10.999Z] 22:44:10     INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/contextMenu/browser_strip_on_share_link.js | Timed out while polling clipboard for requested data, got: https://www.example.com/?stripParam=1234 - 
[task 2023-10-26T22:44:11.000Z] 22:44:10     INFO - Stack trace:
[task 2023-10-26T22:44:11.001Z] 22:44:10     INFO - chrome://mochikit/content/browser-test.js:test_ok:1583
[task 2023-10-26T22:44:11.003Z] 22:44:10     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:putAndVerify:1231
[task 2023-10-26T22:44:11.004Z] 22:44:10     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.promiseClipboardChange:1259
[task 2023-10-26T22:44:11.004Z] 22:44:10     INFO - chrome://mochitests/content/browser/browser/base/content/test/contextMenu/browser_strip_on_share_link.js:testStripOnShare/<:177
[task 2023-10-26T22:44:11.005Z] 22:44:10     INFO - resource://testing-common/BrowserTestUtils.sys.mjs:withNewTab:146
[task 2023-10-26T22:44:11.006Z] 22:44:10     INFO - chrome://mochitests/content/browser/browser/base/content/test/contextMenu/browser_strip_on_share_link.js:testStripOnShare:141
[task 2023-10-26T22:44:11.007Z] 22:44:10     INFO - chrome://mochitests/content/browser/browser/base/content/test/contextMenu/browser_strip_on_share_link.js:testQueryParamIsStrippedSelectURL:44
[task 2023-10-26T22:44:11.008Z] 22:44:10     INFO - chrome://mochikit/content/browser-test.js:handleTask:1134
[task 2023-10-26T22:44:11.009Z] 22:44:10     INFO - chrome://mochikit/content/browser-test.js:_runTaskBasedTest:1206
[task 2023-10-26T22:44:11.010Z] 22:44:10     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1348
[task 2023-10-26T22:44:11.011Z] 22:44:10     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:1123
[task 2023-10-26T22:44:11.012Z] 22:44:10     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/<:1058
[task 2023-10-26T22:44:11.014Z] 22:44:11     INFO - Not taking screenshot here: see the one that was previously logged
[task 2023-10-26T22:44:11.016Z] 22:44:11     INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/contextMenu/browser_strip_on_share_link.js | Uncaught exception in test bound testQueryParamIsStrippedSelectURL - at chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:1233 - Error: Timed out while polling clipboard for requested data, got: https://www.example.com/?stripParam=1234
[task 2023-10-26T22:44:11.016Z] 22:44:11     INFO - Stack trace:
[task 2023-10-26T22:44:11.016Z] 22:44:11     INFO - putAndVerify@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:1233:13
[task 2023-10-26T22:44:11.016Z] 22:44:11     INFO - async*SimpleTest.promiseClipboardChange@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:1259:10
[task 2023-10-26T22:44:11.016Z] 22:44:11     INFO - async*testStripOnShare/<@chrome://mochitests/content/browser/browser/base/content/test/contextMenu/browser_strip_on_share_link.js:177:24
[task 2023-10-26T22:44:11.016Z] 22:44:11     INFO - async*withNewTab@resource://testing-common/BrowserTestUtils.sys.mjs:146:22
[task 2023-10-26T22:44:11.016Z] 22:44:11     INFO - async*testStripOnShare@chrome://mochitests/content/browser/browser/base/content/test/contextMenu/browser_strip_on_share_link.js:141:26
[task 2023-10-26T22:44:11.017Z] 22:44:11     INFO - async*testQueryParamIsStrippedSelectURL@chrome://mochitests/content/browser/browser/base/content/test/contextMenu/browser_strip_on_share_link.js:44:9
[task 2023-10-26T22:44:11.017Z] 22:44:11     INFO - handleTask@chrome://mochikit/content/browser-test.js:1134:26
[task 2023-10-26T22:44:11.017Z] 22:44:11     INFO - _runTaskBasedTest@chrome://mochikit/content/browser-test.js:1206:18
[task 2023-10-26T22:44:11.017Z] 22:44:11     INFO - async*Tester_execTest@chrome://mochikit/content/browser-test.js:1348:14
[task 2023-10-26T22:44:11.017Z] 22:44:11     INFO - nextTest/<@chrome://mochikit/content/browser-test.js:1123:14
[task 2023-10-26T22:44:11.017Z] 22:44:11     INFO - SimpleTest.waitForFocus/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:1058:13
[task 2023-10-26T22:44:11.018Z] 22:44:11     INFO - Leaving test bound testQueryParamIsStrippedSelectURL
[task 2023-10-26T22:44:11.019Z] 22:44:11     INFO - Entering test bound testQueryParamIsStripped
[task 2023-10-26T22:44:11.407Z] 22:44:11     INFO - Console message: [JavaScript Warning: "This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”." {file: "https://example.com/browser/browser/base/content/test/general/dummy_page.html" line: 0}]
[task 2023-10-26T22:44:11.937Z] 22:44:11     INFO - TEST-PASS | browser/base/content/test/contextMenu/browser_strip_on_share_link.js | Menu item is visible - true == true -
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Blocks: clean-link
Component: Menus → Privacy: Anti-Tracking
Keywords: priv-triaged
Product: Firefox → Core

It is only reproducible without --headless option to me. Running the test with ./mach test browser/base/content/test/contextMenu/browser_strip_on_share_link.js. The error occurs almost every time for me. With --headless no errors occur.

This one is a bit weird. It seems like the "popupshown" event is handled before "popupshowing". Calling contextMenu.activateItem might require more preconditions than just that the "popupshown" event was emitted.

  1. gContextMenu is initialized in "popupshowing"
  2. gContextMenu is still null when clicking on the context menu link "Strip without Site Tracking"
  3. In the test we wait until the context menu emitted the signal "popupshown"
  4. we even assert that it is visible
  5. adding an await new Promise(r => setTimeout(r, 50)); here makes the intermittent test failure go away. Suggesting this is really a race condition between the two event handlers.

Potential fixes is to do a simple waitForCondition for gContextMenu != null or to emit another signal after initializing gContextMenu and waiting for that signal.

See Also: → 1890664
You need to log in before you can comment on or make changes to this bug.