|
29 | 29 | import java.lang.reflect.Method;
|
30 | 30 | import java.net.ServerSocket;
|
31 | 31 | import java.time.Duration;
|
| 32 | +import java.util.Locale; |
32 | 33 | import java.util.UUID;
|
33 | 34 | import java.util.concurrent.CountDownLatch;
|
34 | 35 | import java.util.concurrent.TimeUnit;
|
@@ -420,6 +421,18 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con
|
420 | 421 | }
|
421 | 422 | }
|
422 | 423 |
|
| 424 | + private static class DisabledOnSemeruCondition |
| 425 | + implements org.junit.jupiter.api.extension.ExecutionCondition { |
| 426 | + |
| 427 | + @Override |
| 428 | + public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { |
| 429 | + String javaRuntimeName = System.getProperty("java.runtime.name"); |
| 430 | + return javaRuntimeName.toLowerCase(Locale.ENGLISH).contains("semeru") |
| 431 | + ? ConditionEvaluationResult.disabled("Test fails on Semeru") |
| 432 | + : ConditionEvaluationResult.enabled("OK"); |
| 433 | + } |
| 434 | + } |
| 435 | + |
423 | 436 | @Target({ElementType.TYPE, ElementType.METHOD})
|
424 | 437 | @Retention(RetentionPolicy.RUNTIME)
|
425 | 438 | @Documented
|
@@ -456,6 +469,12 @@ public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext con
|
456 | 469 | @ExtendWith(DisabledIfNotClusterCondition.class)
|
457 | 470 | @interface DisabledIfNotCluster {}
|
458 | 471 |
|
| 472 | + @Target({ElementType.TYPE, ElementType.METHOD}) |
| 473 | + @Retention(RetentionPolicy.RUNTIME) |
| 474 | + @Documented |
| 475 | + @ExtendWith(DisabledOnSemeruCondition.class) |
| 476 | + public @interface DisabledOnJavaSemeru {} |
| 477 | + |
459 | 478 | static Sync sync() {
|
460 | 479 | return sync(1);
|
461 | 480 | }
|
|
0 commit comments