@@ -16,6 +16,7 @@ public class LRACoordinatorManager {
16
16
private static final int DEFAULT_PRECEDENCE = -100 ;
17
17
private static final Logger LOGGER = LoggerFactory .getLogger (LRACoordinatorManager .class );
18
18
private final int coordinatorPort = getFreePort (50000 , 60000 );
19
+ private String quarkusLraDevservicesEnabledValue = null ;
19
20
20
21
private GenericContainer coordinatorContainer ;
21
22
@@ -30,25 +31,31 @@ public void beforeClass(
30
31
// need to run with host network because coordinator calls the TCK services from the container
31
32
.withNetworkMode ("host" )
32
33
.waitingFor (Wait .forLogMessage (".*lra-coordinator-quarkus.*" , 1 ));
33
- ;
34
34
35
35
coordinatorContainer .start ();
36
36
coordinatorContainer .followOutput (logConsumer );
37
37
System .setProperty ("lra.coordinator.url" , String .format ("http://localhost:%d/lra-coordinator" , coordinatorPort ));
38
38
// Can we reuse Dev Services for LRA coordinator here?
39
- System .setProperty ("quarkus.lra.devservices.enabled" , "false" );
40
39
}
40
+
41
+ // Always disable Quarkus LRA Dev Services (even if ran without a separate coordinator)
42
+ quarkusLraDevservicesEnabledValue = System .getProperty ("quarkus.lra.devservices.enabled" );
43
+ System .setProperty ("quarkus.lra.devservices.enabled" , "false" );
41
44
}
42
45
43
46
public void afterClass (
44
47
@ Observes (precedence = DEFAULT_PRECEDENCE ) org .jboss .arquillian .test .spi .event .suite .AfterSuite event ) {
45
48
if (coordinatorContainer != null && coordinatorContainer .isRunning ()) {
46
49
coordinatorContainer .stop ();
50
+
51
+ // clear the system property so that it does not affect other tests
52
+ System .clearProperty ("lra.coordinator.url" );
47
53
}
48
54
49
- // clear the system property so that it does not affect other tests
50
- System .clearProperty ("lra.coordinator.url" );
51
- System .clearProperty ("quarkus.lra.devservices.enabled" );
55
+ if (quarkusLraDevservicesEnabledValue != null ) {
56
+ System .setProperty ("quarkus.lra.devservices.enabled" , quarkusLraDevservicesEnabledValue );
57
+ quarkusLraDevservicesEnabledValue = null ;
58
+ }
52
59
}
53
60
54
61
public int getFreePort (int from , int to ) {
0 commit comments