Replace safeguard for fork with multiple threads

  • Close gRPC channels when no longer used instead of relying on garbage collection. This fixes sporadically hanging tests due to gRPC channels used in the main test process (as most tests don't run in separate processes, disable_fork() is not sufficient).
  • Stop background thread created by the multiprocessing queue in tests/testutils/http_server.py (possibly related to 'netrc' test hangs).
  • Replace disable_fork() with is_fork_allowed() safeguard. Instead of checking whether fork is disabled before opening a gRPC channel, check that the process is single-threaded and there are no gRPC channels open before forking / running the scheduler. This is simpler as it no longer needs disable_fork() calls, and it also covers more cases as it works across multiple bst CLI invocations in a single test process.
  • Add autouse fixture to catch tests that don't shut down background thread.

Merge request reports

Loading
Loading