From 5593e95e895006faee2fcd19816c98de987dae31 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Thu, 11 Mar 2021 10:14:12 +0100 Subject: [PATCH] Do not assert thread count in ParallelApplicationEventsIntegrationTests --- .../ParallelApplicationEventsIntegrationTests.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/event/ParallelApplicationEventsIntegrationTests.java b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/event/ParallelApplicationEventsIntegrationTests.java index ec7b061c1a..bf12679653 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/event/ParallelApplicationEventsIntegrationTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/event/ParallelApplicationEventsIntegrationTests.java @@ -68,13 +68,17 @@ class ParallelApplicationEventsIntegrationTests { Set testNames = payloads.stream()// .map(payload -> payload.substring(0, payload.indexOf("-")))// .collect(Collectors.toSet()); - Set 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 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); } + */ }