|
8 | 8 |
|
9 | 9 | package org.elasticsearch.persistent;
|
10 | 10 |
|
11 |
| -import org.apache.lucene.util.LuceneTestCase; |
12 | 11 | import org.elasticsearch.ResourceAlreadyExistsException;
|
13 | 12 | import org.elasticsearch.ResourceNotFoundException;
|
14 | 13 | import org.elasticsearch.action.support.PlainActionFuture;
|
|
34 | 33 | import java.util.Objects;
|
35 | 34 |
|
36 | 35 | import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFutureThrows;
|
| 36 | +import static org.hamcrest.Matchers.either; |
37 | 37 | import static org.hamcrest.Matchers.empty;
|
38 | 38 | import static org.hamcrest.Matchers.equalTo;
|
39 | 39 | import static org.hamcrest.Matchers.hasSize;
|
|
42 | 42 | import static org.hamcrest.Matchers.nullValue;
|
43 | 43 | import static org.hamcrest.core.Is.is;
|
44 | 44 |
|
45 |
| -@LuceneTestCase.AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/75012") |
46 | 45 | @ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.SUITE, minNumDataNodes = 2)
|
47 | 46 | public class PersistentTasksExecutorIT extends ESIntegTestCase {
|
48 | 47 |
|
@@ -363,7 +362,13 @@ public void testAbortLocally() throws Exception {
|
363 | 362 | // Verify that the task is STILL in internal cluster state, unassigned, with a reason indicating local abort
|
364 | 363 | PersistentTask<?> task = assertClusterStateHasTask(taskId);
|
365 | 364 | assertThat(task.getAssignment().getExecutorNode(), nullValue());
|
366 |
| - assertThat(task.getAssignment().getExplanation(), equalTo("Simulating local abort")); |
| 365 | + // Although the assignment explanation is initially set to "Simulating local abort", because |
| 366 | + // of the way we prevent reassignment to the same node in this test it may quickly change to |
| 367 | + // "non cluster state condition prevents assignment" - either proves the unassignment worked |
| 368 | + assertThat(task.getAssignment().getExplanation(), |
| 369 | + either(equalTo("Simulating local abort")) |
| 370 | + .or(equalTo("non cluster state condition prevents assignment")) |
| 371 | + ); |
367 | 372 | });
|
368 | 373 |
|
369 | 374 | // Allow it to be reassigned again
|
|
0 commit comments