Skip to content

Turn off Firefox's bounce-tracking protection in tests - #6352

Merged
max-sixty merged 1 commit into
mainfrom
firefox-bounce-tracking
Nov 18, 2026
Merged

max-sixty merged 1 commit into
mainfrom
firefox-bounce-tracking

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Firefox's bounce-tracking protection logs "“127.0.0.1” has been classified as a bounce tracker" on whichever page is showing when a test's navigations trip it, and the browser fixtures fail a test on any unconsumed warning. That warning is what failed the teardown of the Firefox test_every_part_of_a_floating_box_moves_one_way_per_input in the Nov 17 macOS nightly. This sets privacy.bounceTrackingProtection.mode: 0 (MODE_DISABLED in Firefox's nsIBounceTrackingProtection.idl) in FIREFOX_PREFS, which both the suite's firefox_browser and leaf-dev's Firefox launch with, and drops the hand filter for the same warning from the departure test in test_readiness.py.

Closes #6183. Of its four tests, two passed in the Nov 17 nightly and this change fixes the third. The fourth, test_page_fixture_renders[feature-gallery], errored in teardown on Chromium's net::ERR_NETWORK_CHANGED for loopback loads, as did test_a_text_document_refresh_keeps_selection_in_unchanged_text two hours earlier in the same job. No other open issue tracks that failure, so it loses its owner when this merges.

Max picked this change from his GitHub review queue page. Tested with a scratch page that bounces from localhost through a cookie-setting 127.0.0.1 redirect back to localhost, which logged the warning once under the old prefs and never under the new ones, and with the departure test, which passes.

This was written by Claude Code on behalf of max-sixty

Firefox classifies a host that a tab passes through without user activation, once the host stored state, as a bounce tracker, and logs a console warning on the page showing at the time. Every test page comes from 127.0.0.1, so a Firefox test can trip it, and the browser fixtures fail a test on any unconsumed warning. The Nov 17 macOS nightly (run 44068597322) errored in the teardown of the Firefox floating-box motion journey on exactly that warning, and the departure test in test_readiness.py had filtered it by hand since #3825.

FIREFOX_PREFS now sets `privacy.bounceTrackingProtection.mode` to 0, `nsIBounceTrackingProtection.MODE_DISABLED`, so neither the suite's `firefox_browser` nor `leaf-dev`'s Firefox runs the feature. The departure test now accepts only the aborted module load it causes. A scratch page that bounces from localhost through a cookie-setting 127.0.0.1 redirect back to localhost logged the warning once with the old prefs and not at all with the new ones.

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closes #6183 leaves the fourth test, test_page_fixture_renders[feature-gallery] (Chromium net::ERR_NETWORK_CHANGED on loopback loads, also seen on test_a_text_document_refresh_keeps_selection_in_unchanged_text), with no owner once this merges, as the description notes. Could you either change it to Part of #6183 and say what's left, or open an issue for the ERR_NETWORK_CHANGED failure so the next macOS nightly that shows it has somewhere to go?

@max-sixty
max-sixty merged commit 2b88e3e into main Nov 18, 2026
5 checks passed
@max-sixty
max-sixty deleted the firefox-bounce-tracking branch November 18, 2026 06:44
max-sixty added a commit that referenced this pull request Nov 18, 2026
The macOS nightly loses tests to Chromium's `net::ERR_NETWORK_CHANGED`
because the runner drops its own address once an hour. Its DHCP server
answers a new client but never a renewal, so when each one-hour lease
ends, configd removes the address and gets the same one back about 3 s
later. Chromium reads each step as an IP address change and fails every
loopback load still waiting for a socket. In the [Nov
17](https://github.com/max-sixty/leaf/actions/runs/44068597322) and [Nov
15](https://github.com/max-sixty/leaf/actions/runs/43706054091)
nightlies that failed three tests in teardown after their bodies passed,
both nights at 12:50 UTC, two hours into the job. Linux runs show none.

This makes `test-macos`'s first step set the leased address, router and
DNS server by hand, so the interface stays unchanged for the rest of the
job.

Evidence, from a throwaway workflow on this branch that has since been
deleted:

- [Unchanged
runner](https://github.com/max-sixty/leaf/actions/runs/44254650627):
configd logged "server not responding" and removed `192.168.64.10` at
07:52:40, then again at 08:52:57, each time after an hour of unanswered
RENEW and REBIND requests. Each time an idle Chromium's NetLog shows
`NETWORK_MAC_OS_CONFIG_CHANGED` "Notify_Changed" twice, once for the
removal and once for the return.
- [Runner with this
step](https://github.com/max-sixty/leaf/actions/runs/44263219832): the
interface changed once, when the step ran. Over the next 2 h 17 min,
which would have held two lease expiries, configd removed no address and
Chromium logged no change.

To weigh: once this step runs, the runner no longer asks the host's DHCP
server for its address, so after the lease ends the server could give
that address to another VM. Apple's `bootpd` keeps an expired lease's
address reserved for its client until the pool runs out. I haven't
confirmed that GitHub's hosts run `bootpd`. The first scheduled run
after merge is the end-to-end check.

Max asked for this fix after #6352 closed #6183, whose fourth failure
this was.

> _This was written by Claude Code on behalf of max-sixty_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Four tests fail only on macOS in the Nov 16 scheduled run, whose timeout left no junit diagnostics

2 participants