Skip to content

test: fix races in test-performance-eventlooputil

Fix two races in test-performance-eventlooputil resulting in a flaky test.

elu1 was capture after start time t from spin look. If OS descides to reschedule the process after capturing t but before getting elu for >=50ms the spin loop is actually a nop. elu1 doesn't show this and as a result elut3 = eventLoopUtilization(elu1) results in elu3.active is lower then the expected spin time. Moving capturing of t after capturing t, just before the spin look avoids this.

Similar if OS decides to shedule a different process between getting the total elu from start and the diff elu showing the spin loop the check to verify that total active time is long then the spin loop fails. Exchanging these statements avoids this race.

Fixes: #35309 (closed)

fyi @trevnorris

Merge request reports

Loading