Do not assert thread count in ParallelApplicationEventsIntegrationTests

This commit is contained in:
Sam Brannen 2021-03-11 10:14:12 +01:00
parent 6d4c0091b5
commit 5593e95e89
1 changed files with 8 additions and 3 deletions

View File

@ -68,13 +68,17 @@ class ParallelApplicationEventsIntegrationTests {
Set<String> testNames = payloads.stream()//
.map(payload -> payload.substring(0, payload.indexOf("-")))//
.collect(Collectors.toSet());
Set<String> threadNames = payloads.stream()//
.map(payload -> payload.substring(payload.indexOf("-")))//
.collect(Collectors.toSet());
assertThat(payloads).hasSize(10);
assertThat(testNames).hasSize(10);
// The following assertion is currently commented out, since it fails
// regularly on the CI server due to only 1 thread being used for
// parallel test execution on the CI server.
/*
Set<String> threadNames = payloads.stream()//
.map(payload -> payload.substring(payload.indexOf("-")))//
.collect(Collectors.toSet());
int availableProcessors = Runtime.getRuntime().availableProcessors();
// Skip the following assertion entirely if too few processors are available
// to the current JVM.
@ -86,6 +90,7 @@ class ParallelApplicationEventsIntegrationTests {
.as("number of threads used with " + availableProcessors + " available processors")
.hasSizeGreaterThanOrEqualTo(2);
}
*/
}