Skip to content

Fix log expectation inconsistency in flush test #89571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3924,10 +3924,7 @@ protected void commitIndexWriter(final IndexWriter writer, final Translog transl
Loggers.addAppender(LogManager.getLogger(Engine.class), mockLogAppender);

// Issue the first flushOnIdle request. The flush happens in the background using the flush threadpool.
shard.flushOnIdle(0);
assertFalse(shard.isActive());

// Wait for log message that flush acquired lock immediately
// Then wait for log message that flush acquired lock immediately
mockLogAppender.addExpectation(
new MockLogAppender.SeenEventExpectation(
"should see first flush getting lock immediately",
Expand All @@ -3936,6 +3933,8 @@ protected void commitIndexWriter(final IndexWriter writer, final Translog transl
"acquired flush lock immediately"
)
);
shard.flushOnIdle(0);
assertFalse(shard.isActive());
assertBusy(mockLogAppender::assertAllExpectationsMatched);

// While the first flush is happening, index one more doc (to turn the shard's active flag to true),
Expand Down