bharathv commented on a change in pull request #3332:
URL: https://github.com/apache/hbase/pull/3332#discussion_r642797633
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntryStream.java
##########
@@ -530,7 +557,8 @@ public void testReplicationSourceWALReaderWrongPosition()
throws Exception {
@Override
public boolean evaluate() throws Exception {
- return fs.getFileStatus(walPath).getLen() > 0;
+ return fs.getFileStatus(walPath).getLen() > 0 &&
+ ((AbstractFSWAL) log).getInflightWALCloseCount() == 0;
Review comment:
We don't wait for 5s and check. We wait for the condition to pass within
5s or timeout, this is the javadoc, think the test is doing what you are saying
(unless I misunderstood what you are saying)..
```
/**
* Waits up to the duration equal to the specified timeout multiplied by
the
* {@link #getWaitForRatio(Configuration)} for the given {@link Predicate}
to become
* <code>true</code>, failing the test if the timeout is reached and the
Predicate is still
* <code>false</code>.
* <p/>
* @param conf the configuration
* @param timeout the timeout in milliseconds to wait for the predicate.
* @param predicate the predicate to evaluate.
* @return the effective wait, in milli-seconds until the predicate
becomes <code>true</code> or
* wait is interrupted otherwise <code>-1</code> when times out
*/
```
##########
File path:
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntryStream.java
##########
@@ -103,6 +107,27 @@
private static final NavigableMap<byte[], Integer> scopes = getScopes();
private final String fakeWalGroupId = "fake-wal-group-id";
+ /**
+ * Test helper that waits until a non-null entry is available in the stream
next or times out.
+ */
+ private static class WALEntryStreamWithRetries extends WALEntryStream {
Review comment:
Addressed in #3344
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]