Skip to content

Commit 2ca3fa0

Browse files
committed
concurrency test improvement
1 parent 66ac5ab commit 2ca3fa0

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

operator-framework/src/test/java/com/github/containersolutions/operator/ConcurrencyIT.java

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import java.util.List;
1111
import java.util.concurrent.TimeUnit;
1212

13-
import static com.github.containersolutions.operator.IntegrationTestSupport.TEST_CUSTOM_RESOURCE_PREFIX;
1413
import static com.github.containersolutions.operator.IntegrationTestSupport.TEST_NAMESPACE;
1514
import static org.assertj.core.api.Assertions.assertThat;
1615

@@ -62,18 +61,8 @@ public void manyResourcesGetCreatedUpdatedAndDeleted() throws InterruptedExcepti
6261
tcr.getSpec().setValue(i + UPDATED_SUFFIX);
6362
integrationTest.getCrOperations().inNamespace(TEST_NAMESPACE).createOrReplace(tcr);
6463
}
65-
66-
Awaitility.await().atMost(1, TimeUnit.MINUTES)
67-
.untilAsserted(() -> {
68-
List<TestCustomResource> crs = integrationTest.getCrOperations()
69-
.inNamespace(TEST_NAMESPACE)
70-
.list().getItems();
71-
for (int i = 0; i < NUMBER_OF_RESOURCES_UPDATED; i++) {
72-
final int k = i;
73-
TestCustomResource testCustomResource = crs.stream().filter(c -> c.getMetadata().getName().equals(TEST_CUSTOM_RESOURCE_PREFIX + k)).findFirst().get();
74-
assertThat(testCustomResource.getSpec().getValue()).isEqualTo(i + UPDATED_SUFFIX);
75-
}
76-
});
64+
// sleep to make some variability to the test, so some updates are not executed before delete
65+
Thread.sleep(300);
7766

7867
log.info("Deleting resources.");
7968
// deleting some resources

0 commit comments

Comments
 (0)