You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When running gradle check for windows distribution., #4924, The tests in ResourceAwareTasksTests frequently fail on windows. The tests fail because the CPU time at the end of each test is zero, and the test asserts a positive value. threadMXBean.getThreadCpuTime(threadId)here is returning a zero value.
To Reproduce
Steps to reproduce the behavior:
On any windows machine run ResourceAwareTasksTests. At least once per 1-2 runs a failure will occur.
Expected behavior
Test should pass.
The text was updated successfully, but these errors were encountered:
The issue here is that on windows the clock tick is ~15ms. The actual runnable in the test is completing before that time and so threadMXBean is still set to 0.
We can resolve this by waiting until a full tick is registered inside ResourceAwareNodesAction.doRun
if (Constants.WINDOWS) {
while (threadMXBean.getThreadCpuTime(Thread.currentThread().getId()) <= 0) {
}
}
This will also cause the mem consumed to be out of the existing limits set in the test assertions, so we'd need to adjust the buffer applied in assertMemoryUsageWithinLimits. @Bukhtawar@ketanv3, wondering if either of you could shed light on why we need those assertions, would a positive value not suffice for these tests & be less flaky?
or alternatively we could simply update all assertions to assume cpu is >= to 0 rather than >0, or skip the test entirely on windows.
Have cut a PR here to simply allow zero value on windows. Given we are directly populating the cpu value from ThreadMXBean I think this is safe. I'd rather go this route than introduce additional flakiness into the memory assertion.
Describe the bug
When running gradle check for windows distribution., #4924, The tests in ResourceAwareTasksTests frequently fail on windows. The tests fail because the CPU time at the end of each test is zero, and the test asserts a positive value.
threadMXBean.getThreadCpuTime(threadId)
here is returning a zero value.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Test should pass.
The text was updated successfully, but these errors were encountered: