Skip to content

Commit 43ba344

Browse files
author
Hendrik Muhs
authored
fix a timing issue: isFinished is used for a busy loop in testing, (#41055)
test: ensure state is persisted before the isFinished is changed fixes #41046
1 parent f4c12f0 commit 43ba344

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

x-pack/plugin/rollup/src/test/java/org/elasticsearch/xpack/rollup/job/RollupIndexerStateTests.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ public void testStarted() throws Exception {
256256
}
257257
}
258258

259-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/41046")
260259
public void testIndexing() throws Exception {
261260
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
262261
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
@@ -267,8 +266,8 @@ public void testIndexing() throws Exception {
267266
@Override
268267
protected void onFinish(ActionListener<Void> listener) {
269268
super.onFinish(ActionListener.wrap(r -> {
270-
isFinished.set(true);
271269
listener.onResponse(r);
270+
isFinished.set(true);
272271
}, listener::onFailure));
273272
}
274273
};
@@ -316,8 +315,8 @@ public void testStateChangeMidTrigger() throws Exception {
316315
@Override
317316
protected void onFinish(ActionListener<Void> listener) {
318317
super.onFinish(ActionListener.wrap(r -> {
319-
isFinished.set(true);
320318
listener.onResponse(r);
319+
isFinished.set(true);
321320
}, listener::onFailure));
322321
}
323322
};

0 commit comments

Comments
 (0)