diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8468393..83b7d77 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: run: | export JAVA_HOME=${JAVA_HOME_17_X64} export PATH=~/dev/savant/current/bin:${JAVA_HOME}/bin:$PATH - sb clean int + sb clean int --excludePerformance --excludeTimeouts shell: bash - name: Archive TestNG reports if: failure() diff --git a/build.savant b/build.savant index ef80863..701cb97 100644 --- a/build.savant +++ b/build.savant @@ -80,9 +80,12 @@ target(name: "jar", description: "Builds the project JARs", dependsOn: ["compile } target(name: "test", description: "Runs the project's tests", dependsOn: ["jar"]) { - var exclude = ["performance"] - if (switches.has("includePerformance")) { - exclude = [] + var exclude = [] + if (switches.has("excludePerformance")) { + exclude << "performance" + } + if (switches.has("excludeTimeouts")) { + exclude << "timeouts" } javaTestNG.test(exclude: exclude) diff --git a/java-http.ipr b/java-http.ipr index 11372a7..3b37e61 100644 --- a/java-http.ipr +++ b/java-http.ipr @@ -35,10 +35,11 @@ diff --git a/src/test/java/io/fusionauth/http/BaseTest.java b/src/test/java/io/fusionauth/http/BaseTest.java index 411e20b..d31914e 100644 --- a/src/test/java/io/fusionauth/http/BaseTest.java +++ b/src/test/java/io/fusionauth/http/BaseTest.java @@ -332,7 +332,7 @@ public void sendBadRequest(String message) { } } - @AfterSuite(groups = "acceptance") + @AfterSuite public void tearDown() { System.out.println("\nTests began : " + hh_mm_ss_SSS.format(TestStarted)); System.out.println("Tests ended : " + hh_mm_ss_SSS.format(ZonedDateTime.now())); diff --git a/src/test/java/io/fusionauth/http/CoreTest.java b/src/test/java/io/fusionauth/http/CoreTest.java index 4e18ee8..f2e08ac 100644 --- a/src/test/java/io/fusionauth/http/CoreTest.java +++ b/src/test/java/io/fusionauth/http/CoreTest.java @@ -252,7 +252,7 @@ public void hugeHeaders(String scheme) throws Exception { } } - @Test + @Test(groups = "timeouts") public void initialReadTimeout() { // This test simulates if the client doesn't send bytes for the initial timeout HTTPHandler handler = (req, res) -> fail("Should not be called"); @@ -279,7 +279,7 @@ public void initialReadTimeout() { assertEquals(instrumenter.getClosedConnections(), 1); } - @Test + @Test(groups = "timeouts") public void keepAliveTimeout() { // This test only works with GET and the URLConnection because this setup will re-submit the same request if the Keep-Alive connection // is terminated by the server @@ -541,7 +541,7 @@ public void serverClosesSockets(String scheme) { } } - @Test + @Test(groups = "timeouts") public void serverTimeout() throws Exception { // This test simulates if the server has a long-running thread that doesn't write fast enough HTTPHandler handler = (req, res) -> { @@ -721,7 +721,7 @@ public void simplePost(String scheme, int responseBufferSize) throws Exception { } } - @Test(dataProvider = "schemes") + @Test(dataProvider = "schemes", groups = "timeouts") public void slowClient(String scheme) throws Exception { // Test a slow connection where the HTTP server is blocked because we cannot write to the output stream as fast as we'd like. The // default buffer on macOS seems to be 768k (from my testing). I set this to 8MB which should hopefully cause the writes to back up. @@ -770,7 +770,7 @@ public void slowClient(String scheme) throws Exception { } } - @Test + @Test(groups = "timeouts") public void slowHandler() { AtomicBoolean called = new AtomicBoolean(false); HTTPHandler handler = (req, res) -> {