Page MenuHomePhabricator

Mocha "after" block doesn't run if a test times out
Open, HighPublic

Description

Description

Repro instructions:

  • In test/features/v1/javascript-all-test.js, reduce the timeout to something small (~20000 if you will run the tests on CI; perhaps ~2000 otherwise).
  • Run the test-javascript-all-wasm-evaluator variant
  • Note that javascript - debug times out, and then the test runner waits forever (only failing on CI after the one-hour CI runner timeout)

Thoughts

It appears that Mocha's after block doesn't run if a test times out. This is unfortunate, because the drainTheSwamps call there is what prevents the test runner from spin-waiting forever. This is because the executor pool maintains a series of subprocesses, and as long as one subprocess is running, the CI test runner (or local docker container) won't terminate.

Desired behavior/Acceptance criteria (returned value, expected error, performance expectations, etc.)

  • after block (or equivalent cleanup code) should still trigger even after a timeout

Completion checklist