Skip to content
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

Disable search context release checks after every test #56673

Merged
merged 5 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -348,6 +348,14 @@ protected final boolean enableWarningsCheck() {
return false;
}

@Override
protected boolean enableSearchContextAfterCheck() {
// We don't want to check the release of search contexts between tests if the cluster is shared.
jimczi marked this conversation as resolved.
Show resolved Hide resolved
// The release of search contexts is always checked at the end, when the cluster is cleared so
// we're just skipping this operation between tests.
return getCurrentClusterScope() == Scope.TEST;
}

protected final void beforeInternal() throws Exception {
final Scope currentClusterScope = getCurrentClusterScope();
Callable<Void> setup = () -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,13 @@ protected boolean enableWarningsCheck() {
return true;
}

/**
* Whether or not we check after each test whether it has left search contexts behind.
*/
protected boolean enableSearchContextAfterCheck() {
return true;
}

@After
public final void after() throws Exception {
checkStaticState(false);
Expand All @@ -375,7 +382,9 @@ public final void after() throws Exception {
DeprecationLogger.removeThreadContext(threadContext);
threadContext = null;
}
ensureAllSearchContextsReleased();
if (enableSearchContextAfterCheck()) {
ensureAllSearchContextsReleased();
}
ensureCheckIndexPassed();
logger.info("{}after test", getTestParamsForLogging());
}
Expand Down