teamconfx opened a new pull request, #6066:
URL: https://github.com/apache/accumulo/pull/6066
This PR is for fixing #6050.
## Summary
- Fixed inverted condition in Wait.waitFor() that was waiting for
compactions to be empty instead of waiting for a compaction to start
- Added pre-condition assertion to verify no compactions are running
before the test begins, catching any leftover state from other tests
## Description
In
ExternalCompactionProgressIT.testCompactionDurationContinuesAfterCoordinatorStop(),
the Wait.waitFor() condition was inverted. The code comment indicated it
should "Wait until the compaction starts", but the actual condition compactions
== null || compactions.isEmpty() was waiting for the opposite—no compactions to
be running.
Before:
```java
Wait.waitFor(() -> {
Map<String,TExternalCompaction> compactions =
getRunningCompactions(getCluster().getServerContext()).getCompactions();
return compactions == null || compactions.isEmpty(); // BUG: waits for
NO compactions
}, 30_000, 100, "Compaction did not start within the expected time");
```
After:
```java
Wait.waitFor(() -> {
Map<String,TExternalCompaction> compactions =
getRunningCompactions(getCluster().getServerContext()).getCompactions();
return compactions != null && !compactions.isEmpty(); // Correctly
waits for compaction to start
}, 30_000, 100, "Compaction did not start within the expected time");
```
The test was still passing because sleepUninterruptibly(6,
TimeUnit.SECONDS) followed the wait, giving enough time for the compaction to
actually start. However, compactionStartTime was not
accurately reflecting when the compaction truly started.
Additionally, a pre-condition check was added to ensure no compactions are
running before the test begins, which helps catch any accidental leftover state
from other tests as requested in #6050.
--
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]