anoopsjohn commented on a change in pull request #3332:
URL: https://github.com/apache/hbase/pull/3332#discussion_r642784905
##########
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 wait for 5 sec and check. Should be wait for
getInflightWALCloseCount to be zero before coming here? Or will that be a
better guarantee for WAL close has happened where we come here for FS.getLen()
check?
##########
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:
Can u also pls explain why we use this special subclass here for the
tests? (as comments) will be easy to read and digest later.
--
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]