DiamondLightSource / tickit

Event-based hardware simulation framework
Apache License 2.0
7 stars 0 forks source link

Catch HTTP adapter run_forever failures in test fixture #165

Closed rosesyrett closed 1 year ago

rosesyrett commented 1 year ago

Currently on master, running pytest if port 8080 on localhost is bound freezes the output. The terminal simply hangs. I have investigated the issue and fixed this by changing the fixture where this is happening so that it keeps track of the task that calls .run_forever on the adaptor as well as .wait_until_ready and waits until one of those completes.

wait_until_ready will only ever be set if run_forever gets far enough to set it; if, for example, the server cannot be instantiated, this fails silently, and wait_until_ready therefore waits forever.

codecov[bot] commented 1 year ago

Codecov Report

Merging #165 (539d44d) into master (9380b1a) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #165   +/-   ##
=======================================
  Coverage   95.03%   95.03%           
=======================================
  Files          44       44           
  Lines        1310     1310           
=======================================
  Hits         1245     1245           
  Misses         65       65