Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the flaky test in ThrottlingExecutorSuite (#12094)
The `test task metrics` test is flaky. This test verifies the max throttle time metric in the `ThrottlingExecutor` while there are two tasks in the executor, one running and another waiting. The way it measures the expected max of the max throttle time is not quite right. Here is a brief summary of what this test does: - The main thread submits a task. This task runs until it is told to stop. - Another thread submits a task. This task waits until the running task finishes. - The main thread sleeps for a certain time. - The main thread stops the running task. This will let the waiting task run. - The main thread verifies the max throttle time by comparing it to the _sleep_ time. The last verification can flake because the sleep time may not reflect the actual wait time in the `ThrottlingExecutor`. Submitting a task can take some time which will reduce the actual wait time in the executor. This PR fixes this test by using the actual wait time to validate the metric. --------- Signed-off-by: Jihoon Son <[email protected]>
- Loading branch information