Open Bug 1273986 Opened 8 years ago Updated 2 years ago

Run reftests in random order in automation

Categories

(Testing :: Reftest, defect)

Version 3
defect

Tracking

(Not tracked)

People

(Reporter: gps, Unassigned)

Details

Attachments

(1 file)

Trivial patch coming up shortly.
When tests are executed in the same order every time, undetected
cross-test dependencies can be introduced, leading to unexpected
passes or failures.

This commit randomizes the execution of reftests in automation.
This should hopefully lead to more test failures due to previously
undetected ordering dependencies and possibly even race conditions.

While this may upset people who care about seeing fewer test
failures, running tests in random order is more indicative of real
life browser behavior and thus could lead to higher browser quality
and stability.

Review commit: https://reviewboard.mozilla.org/r/53628/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/53628/
Attachment #8753979 - Flags: review?(dbaron)
The Try push at https://treeherder.mozilla.org/#/jobs?repo=try&revision=42bf784f43b25bf3d03ce6d5ccdcfa384c792a57 has possibly uncovered some new failures on Windows as a result of this.
How does shuffle deal with the chunking of the reftests?  Does it just shuffle within the chunk?

Is there a mechanism for replaying an order in which a failure was observed?
Flags: needinfo?(gps)
Chunking occurs before shuffling.

We'll want the ability to seed the RNG so shuffle order can be specified and reproducible. Alternatively, we could invent a mechanism to save the execution order to a file and provide a mechanism to execute from that. RND seeding feels slightly easier.
Flags: needinfo?(gps)
It looks like the shuffle is done in JavaScript. I, uh, don't think JavaScript offers a way to seed a random number generator. Perhaps we have something in XPCOM to do this. I suppose we could change the Fisher-Yates shuffle in reftest.jsm to something else (that only needs a single random value which we can set in a pref).
I'm not actively working on this. I would encourage someone to pick it up because executing tests in random order is a good way to flush out bugs.
Assignee: gps → nobody
Status: ASSIGNED → NEW
Comment on attachment 8753979 [details]
MozReview Request: Bug 1273986 - Execute reftests in random order; r?dbaron

Dropping stale review flag to get this bug out of the triage dashboard.
Attachment #8753979 - Flags: review?(dbaron)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: