The GitHub Actions job "Benchmarks PR Comment" on texera.git/main has failed.
Run started by GitHub user lie18uci (triggered by lie18uci).

Head commit for run:
80542aaaab476b675b10dbd54787c75982913b91 / Kunwoo (Chris) 
<[email protected]>
test(amber): fix ConcurrentModificationException flake in 
RegionExecutionCoordinatorSpec (#5562)

### What changes were proposed in this PR?

`RegionExecutionCoordinatorSpec`'s *"retry EndWorker failures…"* test
polled the `ControllerRpcProbe.calls` buffer from the test thread
(`waitUntil(endWorkerCalls.size >= 2)`) while the coordinator's 200 ms
`EndWorker` retry appended to it from the kill-retry timer thread. That
read racing an append tripped Scala 2.13's `MutationTracker` and
surfaced as a non-deterministic
`java.util.ConcurrentModificationException`.

The `calls` buffer is test-only — production has no such buffer and
never reads it — so the race is a property of the test, not the source.
Rather than make the test helper thread-safe, this fixes the test: it
waits on a `CountDownLatch` (counted down from the probe callback once
the retry's `EndWorker` is recorded) instead of polling, so the test
thread never iterates the buffer while the timer thread appends. The
real timer-thread retry still runs, so the production path is exercised
faithfully — the accesses are just ordered (append → latch → read)
instead of overlapping. No production code is changed;
`ControllerRpcProbe` keeps its plain `ArrayBuffer`.

### Any related issues, documentation, discussions?

Resolves #5546

### How was this PR tested?

`RegionExecutionCoordinatorSpec` + `WorkflowExecutionCoordinatorSpec` →
10/10 pass. The retry test is race-free by construction: its only reads
of the call buffer happen after the latch `await` returns — i.e. after
the timer thread has finished appending — so no read can overlap an
append.

```
sbt 'WorkflowExecutionService/testOnly 
org.apache.texera.amber.engine.architecture.scheduling.RegionExecutionCoordinatorSpec'
```

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Anthropic Claude Opus 4.8)

Report URL: https://github.com/apache/texera/actions/runs/27396727630

With regards,
GitHub Actions via GitBox

Reply via email to