teamconfx opened a new issue, #6050:
URL: https://github.com/apache/accumulo/issues/6050
**Describe the bug**
The test
`ExternalCompactionProgressIT.testCompactionDurationContinuesAfterCoordinatorStop`
contains an inverted condition in `Wait.waitFor()` waits for compactions to be
EMPTY instead of waiting for compactions to EXIST.
**Versions (OS, Maven, Java, and others, as appropriate):**
- Affected version(s) of this project: 2.1.4
- OS: Ubutnu 22.04
**The Buggy Code**
**File**:
`test/src/main/java/org/apache/accumulo/test/compaction/ExternalCompactionProgressIT.java`
**Lines**: 146-151
```java
// Wait until the compaction starts
Wait.waitFor(() -> {
Map<String,TExternalCompaction> compactions =
getRunningCompactions(getCluster().getServerContext()).getCompactions();
return compactions == null || compactions.isEmpty(); // <-- BUG:
Inverted condition
}, 30_000, 100, "Compaction did not start within the expected time");
// start a timer after the compaction starts
long compactionStartTime = System.nanoTime();
// let the compaction advance a bit
sleepUninterruptibly(6, TimeUnit.SECONDS);
```
The current test can still pass because there is a sleepUninterruptibly(),
but the startTime actually is NOT really the start time when the compaction
starts.
**Expected behavior**:
- Wait should return when there ARE running compactions
- Condition should be: `compactions != null && !compactions.isEmpty()`
**Additional context**
Happy to send a PR for this issue.
--
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]