Fix worker lifecycle: terminate workers to prevent interference between tests#748
Fix worker lifecycle: terminate workers to prevent interference between tests#748
Conversation
Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
Co-authored-by: sstidl <12804296+sstidl@users.noreply.github.com>
|
The change looks clever and I applied it to my speedtest.js. However, the second test still shows anomalous results: download about a half and upload at 0.00. Sometimes there's high jitter, sometimes not. |
Is your testing in parallel or sequentially? |
|
We're testing sequentially. The second test cannot start before the first is done. I primarily run tests on the local network, which is connected to a third interface, the default gateway for the local network. Some instabilities appear to be related to the server's internal forwarding. However, the previously reported anomaly—half the download rate and zero upload rate—occurs in the second test, regardless of which interface was tested first. |
Workers were never terminated after test completion, causing orphaned workers to continue making requests. This resulted in resource contention and corrupted measurements when running multiple tests sequentially—particularly manifesting as abnormally high jitter values (4000+ ms instead of <10 ms).
Changes
Validation
Created
examples/test_multiple_instances.htmldemonstrating multiple sequential tests now produce consistent measurements:Before:

After:

Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.