File tree 1 file changed +6
-1
lines changed
server/src/internalClusterTest/java/org/opensearch/search/pit
1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,12 @@ public Settings onNodeStopped(String nodeName) throws Exception {
117
117
ActionFuture <CreatePitResponse > execute = client ().execute (CreatePitAction .INSTANCE , request );
118
118
ExecutionException ex = expectThrows (ExecutionException .class , execute ::get );
119
119
assertTrue (ex .getMessage ().contains ("Failed to execute phase [create_pit]" ));
120
- validatePitStats ("index" , 0 , 0 );
120
+ // If the search must make a transport call to start the search then a
121
+ // PIT context may be temporarily created on a separate thread. The test
122
+ // will end up racing with the PIT decrement call and can very briefly
123
+ // observe non-zero PIT stats, so we poll here and wait for stats to eventually
124
+ // resolve to zero. In almost all cases the first call will observe zero stats.
125
+ assertBusy (() -> validatePitStats ("index" , 0 , 0 ));
121
126
return super .onNodeStopped (nodeName );
122
127
}
123
128
});
You can’t perform that action at this time.
0 commit comments