Bug 2000191: fix intermittent test failure caused by race condition. #243 (firefox-autoland@autoland)

Warnings
  • Checking...
Blockers
  • Checking...
Last try job No try jobs found.
Branches fix-race-condition-in-synced-tabs-storage-test -> autoland
Repo firefox-autoland@autoland (git) (git://github.com/pollym/firefox.git)
Author pollym
State open
Commit Title Bug 2000191: fix intermittent test failure caused by race condition.
Commit Body Root cause: [Bug 1879332](https://bugzilla.mozilla.org/show_bug.cgi?id=1879332) changed `TabSessionState.isActive()` to use `maxOf(lastAccess, createdAt)`. Since createTab() defaulted `createdAt = System.currentTimeMillis()`, newly created test tabs have createdAt ≈ now. With `maxActiveTime = 0`, the check `now - createdAt <= 0` only returns false when at least 1ms has elapsed, making the result dependent on test execution speed. Fix: Pass `createdAt = lastAccess` to all `createTab()` calls in tests that use `maxActiveTime = 0` and expect `inactive = true`. Since lastAccess values like 123L are epoch-old timestamps, `now - maxOf(123L, 123L)` is always a large positive number, so `isActive(0)` deterministically returns `false` regardless of when the test runs.

Landings

Not yet Landed
There has been no attempt to land revisions in this stack.