FrankChen021 opened a new pull request, #20316:
URL: https://github.com/apache/druid/pull/20316
Related to #20312 (item 1).
### Description
`KubernetesTaskRunnerTest.test_start_whenDeserializationExceptionThrown_isIgnored`
fails intermittently on master with:
```
Unexpected method calls:
EasyMock for field KubernetesTaskRunnerTest.peonClient ->
KubernetesPeonClient.deleteCompletedPeonJobsOlderThan(172800000 (long),
MILLISECONDS)
```
Example:
https://github.com/apache/druid/actions/runs/34431507380/job/102727804299
(failed all 4 surefire attempts).
`KubernetesTaskRunner.start()` schedules `deleteCompletedPeonJobsOlderThan`
on a real `ScheduledExecutorService` with an initial delay of 1 ms. Whether the
first cleanup runs before the test's `verifyAll()` depends on thread
scheduling, so the strict mock sometimes sees a call it was not told to expect.
#### Changes
* In the three tests that call `runner.start()` on a locally created runner,
expect `deleteCompletedPeonJobsOlderThan(anyLong(), MILLISECONDS)` any number
of times via a small helper. Only this one call is relaxed; the rest of
`peonClient` stays strictly verified.
* Stop each locally created runner in a `finally` block so the cleanup
executor does not outlive the test.
Verified locally with `mvn -pl
extensions-core/kubernetes-overlord-extensions test
-Dtest=KubernetesTaskRunnerTest`.
<hr>
##### Key changed/added classes in this PR
* `KubernetesTaskRunnerTest`
<hr>
This PR has:
- [x] been self-reviewed.
- [x] added or updated unit tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]