Skip to content

Commit 2ae58dd

Browse files
committed
Removing tests that can fail periodically from the Github action by putting them in a new test group and excluding it. Also, performance tests now run by default.
1 parent 09dc503 commit 2ae58dd

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

Diff for: .github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: |
3939
export JAVA_HOME=${JAVA_HOME_17_X64}
4040
export PATH=~/dev/savant/current/bin:${JAVA_HOME}/bin:$PATH
41-
sb clean int
41+
sb clean int --excludePerformance --excludeTimeouts
4242
shell: bash
4343
- name: Archive TestNG reports
4444
if: failure()

Diff for: build.savant

+6-3
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,12 @@ target(name: "jar", description: "Builds the project JARs", dependsOn: ["compile
8080
}
8181

8282
target(name: "test", description: "Runs the project's tests", dependsOn: ["jar"]) {
83-
var exclude = ["performance"]
84-
if (switches.has("includePerformance")) {
85-
exclude = []
83+
var exclude = []
84+
if (switches.has("excludePerformance")) {
85+
exclude << "performance"
86+
}
87+
if (switches.has("excludeTimeouts")) {
88+
exclude << "timeouts"
8689
}
8790

8891
javaTestNG.test(exclude: exclude)

Diff for: java-http.ipr

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@
3535
<inspection_tool class="groupsTestNG" enabled="true" level="WARNING" enabled_by_default="true">
3636
<option name="groups">
3737
<value>
38-
<list size="3">
38+
<list size="4">
3939
<item index="0" class="java.lang.String" itemvalue="performance" />
4040
<item index="1" class="java.lang.String" itemvalue="unit" />
4141
<item index="2" class="java.lang.String" itemvalue="acceptance" />
42+
<item index="3" class="java.lang.String" itemvalue="timeouts" />
4243
</list>
4344
</value>
4445
</option>

Diff for: src/test/java/io/fusionauth/http/BaseTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ public void sendBadRequest(String message) {
332332
}
333333
}
334334

335-
@AfterSuite(groups = "acceptance")
335+
@AfterSuite
336336
public void tearDown() {
337337
System.out.println("\nTests began : " + hh_mm_ss_SSS.format(TestStarted));
338338
System.out.println("Tests ended : " + hh_mm_ss_SSS.format(ZonedDateTime.now()));

Diff for: src/test/java/io/fusionauth/http/CoreTest.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public void hugeHeaders(String scheme) throws Exception {
252252
}
253253
}
254254

255-
@Test
255+
@Test(groups = "timeouts")
256256
public void initialReadTimeout() {
257257
// This test simulates if the client doesn't send bytes for the initial timeout
258258
HTTPHandler handler = (req, res) -> fail("Should not be called");
@@ -279,7 +279,7 @@ public void initialReadTimeout() {
279279
assertEquals(instrumenter.getClosedConnections(), 1);
280280
}
281281

282-
@Test
282+
@Test(groups = "timeouts")
283283
public void keepAliveTimeout() {
284284
// This test only works with GET and the URLConnection because this setup will re-submit the same request if the Keep-Alive connection
285285
// is terminated by the server
@@ -541,7 +541,7 @@ public void serverClosesSockets(String scheme) {
541541
}
542542
}
543543

544-
@Test
544+
@Test(groups = "timeouts")
545545
public void serverTimeout() throws Exception {
546546
// This test simulates if the server has a long-running thread that doesn't write fast enough
547547
HTTPHandler handler = (req, res) -> {
@@ -721,7 +721,7 @@ public void simplePost(String scheme, int responseBufferSize) throws Exception {
721721
}
722722
}
723723

724-
@Test(dataProvider = "schemes")
724+
@Test(dataProvider = "schemes", groups = "timeouts")
725725
public void slowClient(String scheme) throws Exception {
726726
// 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
727727
// 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 {
770770
}
771771
}
772772

773-
@Test
773+
@Test(groups = "timeouts")
774774
public void slowHandler() {
775775
AtomicBoolean called = new AtomicBoolean(false);
776776
HTTPHandler handler = (req, res) -> {

0 commit comments

Comments
 (0)