m-lab / ndt-server

docker native ndt5 and ndt7 server with prometheus integration
https://www.measurementlab.net/
Apache License 2.0
99 stars 40 forks source link

Fix: deterministic check for FlowDeleted #397

Closed stephen-soltesz closed 11 months ago

stephen-soltesz commented 11 months ago

The previous test implementation was flaky. This change uses a channel to signal that the FlowDeleted path has been reached.

While the srv.Close() will prevent new connections, and the downloadHelper() closes the client connection, there is still an independent handler goroutine that reaches the FlowDeleted path after a short delay. Rather than using a larger static delay, this change sets a maximum delay and waits for the deleted channel to close, allowing the test to stop as quickly as it's able to.


This change is Reviewable