Skip to content

Commit

Permalink
attempt to fix flaky openapi TCK by using random port
Browse files Browse the repository at this point in the history
(cherry picked from commit 615cc37)
  • Loading branch information
jungm committed Sep 18, 2024
1 parent 8499e09 commit 717fb7a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 4 deletions.
33 changes: 32 additions & 1 deletion tck/microprofile-tck/openapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,38 @@
<name>TomEE :: TCK :: MicroProfile Open API TCK</name>

<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>

<plugins>
<!-- we can't just set httpPort=-1 in arquillian.xml because we need to know the URL below to set as a system property
so instead let's rely on build-helper plugin to reserve an actually free port for us -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>

<executions>
<execution>
<id>reserve-tomee-port</id>

<phase>generate-test-resources</phase>
<goals>
<goal>reserve-network-port</goal>
</goals>

<configuration>
<portNames>
<name>tomee.port</name>
</portNames>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<!-- Updated version to fix hanging text -->
Expand All @@ -39,7 +70,7 @@
<dependency>org.eclipse.microprofile.openapi:microprofile-openapi-tck</dependency>
</dependenciesToScan>
<systemPropertyVariables>
<test.url>http://localhost:50290</test.url>
<test.url>http://localhost:${tomee.port}</test.url>
</systemPropertyVariables>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<container qualifier="tomee-microprofile" default="true">
<configuration>
<property name="httpPort">50290</property>
<property name="httpPort">${tomee.port}</property>
<property name="ajpPort">-1</property>
<property name="stopPort">-1</property>
<property name="classifier">microprofile</property>
Expand All @@ -39,7 +39,7 @@
</container>
<container qualifier="tomee-plus">
<configuration>
<property name="httpPort">50290</property>
<property name="httpPort">${tomee.port}</property>
<property name="ajpPort">-1</property>
<property name="stopPort">-1</property>
<property name="classifier">plus</property>
Expand All @@ -55,7 +55,7 @@
</container>
<container qualifier="tomee-plume">
<configuration>
<property name="httpPort">50290</property>
<property name="httpPort">${tomee.port}</property>
<property name="ajpPort">-1</property>
<property name="stopPort">-1</property>
<property name="classifier">plume</property>
Expand Down

0 comments on commit 717fb7a

Please sign in to comment.