mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
FIX: QUnit tests could time out based on load order (#12342)
By default our QUnit test runner starts automatically. This is normally fine but for our `run-qunit.js` script we add a bunch of QUnit events using `eval` and sometimes those events were added after the tests already started/finished resulting in a hang. This adds a new parameter that will cause QUnit not to run automatically, which the runner uses, then triggers a `start()` when it knows it's ready.
This commit is contained in:
@ -106,8 +106,9 @@ async function runAllTests() {
|
||||
}
|
||||
});
|
||||
|
||||
console.log("navigate to " + args[0]);
|
||||
Page.navigate({ url: args[0] });
|
||||
let url = args[0] + "&qunit_disable_auto_start=1";
|
||||
console.log("navigate to ", url);
|
||||
Page.navigate({ url });
|
||||
|
||||
Page.loadEventFired(async () => {
|
||||
let qff = process.env.QUNIT_FAIL_FAST;
|
||||
@ -281,6 +282,7 @@ function logQUnit() {
|
||||
|
||||
window.qunitDone = context;
|
||||
});
|
||||
QUnit.start();
|
||||
}
|
||||
let qunit_script = logQUnit.toString();
|
||||
|
||||
|
Reference in New Issue
Block a user