You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
server: Fix stuck test process when using qtap.run() with file not found
This didn't affect the CLI because:
* that calls the runWaitFor() wrapper, which happened to work because
it rejects after an 'error' event. And, while the main place to
emit the 'error' event is qtap.run() and we don't reach that here,
there was code in server.js emitting this directly.
* it then calls process.exit(1), thus causing the HTTP Server instance
to be force-closed.
In testing, however, while qtap.run() and qtap.runWaitFor() work fine,
the server stays running in the background, and thus the qunit process
hangs forever because server.js emitted the 'error' event, while
qtap.run() is still awaiting browserPromise, and thus we never got
to the "finally", and thus the server still running.
Avoid this kind of out-of-order processing by making sure the only
place to emit the 'error' event is the qtap.run() code, and only after
the 'finally' branch. So instead, pass the error to browser.stop().
That way, browserPromise will settle by throwing, and from there it
will bubble up to qtap.run().
0 commit comments