Skip to content

Commit 4a2e79c

Browse files
committed
Re-enable 3 flaky multi-client session resume tests via isolated Surefire execution
The tests were @disabled in PR 171 due to timeouts, but pass reliably in isolation. Rather than leaving them disabled, use a JUnit 5 @tag and a separate Surefire execution to run them in their own forked JVM, avoiding harness state leakage from the main test suite. pom.xml: - Add <executions> block to maven-surefire-plugin with two executions: 1. "default-test": runs all tests EXCEPT those tagged "isolated-resume" 2. "isolated-resume-tests": runs ONLY tests tagged "isolated-resume" - Each execution forks a separate JVM, providing process-level isolation. src/test/java/com/github/copilot/sdk/CopilotSessionTest.java: - Remove @disabled annotation from testShouldResumeSessionUsingNewClient - Add @tag("isolated-resume") to the test method - Replace 'import Disabled' with 'import Tag' src/test/java/com/github/copilot/sdk/StreamingFidelityTest.java: - Remove @disabled from testShouldProduceDeltasAfterSessionResume - Remove @disabled from testShouldNotProduceDeltasAfterSessionResumeWithStreamingDisabled - Add @tag("isolated-resume") to both test methods - Replace 'import Disabled' with 'import Tag'
1 parent 8074cce commit 4a2e79c

3 files changed

Lines changed: 31 additions & 8 deletions

File tree

pom.xml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,8 @@
327327
This handles intermittent failures in E2E tests (e.g.,
328328
CompactionTest) where snapshot matching can be sensitive
329329
to non-deterministic compaction behaviour.
330-
TODO: Fix the root cause of CompactionTest flakiness
331-
(snapshot mismatch after compaction) so this retry is
332-
no longer needed.
330+
Revisit this once this issue is successfully resolved.
331+
https://github.com/github/copilot-sdk/issues/1227
333332
-->
334333
<rerunFailingTestsCount>2</rerunFailingTestsCount>
335334
<systemPropertyVariables>
@@ -346,6 +345,30 @@
346345
<COPILOT_CLI_PATH>${copilot.cli.path}</COPILOT_CLI_PATH>
347346
</environmentVariables>
348347
</configuration>
348+
<executions>
349+
<!--
350+
Run multi-client session resume tests in isolation BEFORE the
351+
main suite. These tests pass reliably alone but can time out
352+
when run after other E2E tests due to harness state leakage.
353+
-->
354+
<execution>
355+
<id>isolated-resume-tests</id>
356+
<phase>test</phase>
357+
<goals>
358+
<goal>test</goal>
359+
</goals>
360+
<configuration>
361+
<groups>isolated-resume</groups>
362+
</configuration>
363+
</execution>
364+
<!-- Exclude the isolated resume tests from the main run -->
365+
<execution>
366+
<id>default-test</id>
367+
<configuration>
368+
<excludedGroups>isolated-resume</excludedGroups>
369+
</configuration>
370+
</execution>
371+
</executions>
349372
</plugin>
350373
<!-- Add src/generated/java as an additional source root -->
351374
<plugin>

src/test/java/com/github/copilot/sdk/CopilotSessionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
import org.junit.jupiter.api.AfterAll;
2222
import org.junit.jupiter.api.BeforeAll;
23-
import org.junit.jupiter.api.Disabled;
23+
import org.junit.jupiter.api.Tag;
2424
import org.junit.jupiter.api.Test;
2525

2626
import com.github.copilot.sdk.generated.SessionEvent;
@@ -307,7 +307,7 @@ void testShouldResumeSessionUsingTheSameClient() throws Exception {
307307
* @see Snapshot: session/should_resume_a_session_using_a_new_client
308308
*/
309309
@Test
310-
@Disabled("Passes in isolation but times out in full suite due to test interaction (state leakage or process contention)")
310+
@Tag("isolated-resume")
311311
void testShouldResumeSessionUsingNewClient() throws Exception {
312312
ctx.configureForTest("session", "should_resume_a_session_using_a_new_client");
313313

src/test/java/com/github/copilot/sdk/StreamingFidelityTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import org.junit.jupiter.api.AfterAll;
1616
import org.junit.jupiter.api.BeforeAll;
17-
import org.junit.jupiter.api.Disabled;
17+
import org.junit.jupiter.api.Tag;
1818
import org.junit.jupiter.api.Test;
1919

2020
import com.github.copilot.sdk.generated.SessionEvent;
@@ -140,7 +140,7 @@ void testShouldNotProduceDeltasWhenStreamingIsDisabled() throws Exception {
140140
* @see Snapshot: streaming_fidelity/should_produce_deltas_after_session_resume
141141
*/
142142
@Test
143-
@Disabled("Passes in isolation but times out in full suite due to test interaction (state leakage or process contention)")
143+
@Tag("isolated-resume")
144144
void testShouldProduceDeltasAfterSessionResume() throws Exception {
145145
ctx.configureForTest("streaming_fidelity", "should_produce_deltas_after_session_resume");
146146

@@ -194,7 +194,7 @@ void testShouldProduceDeltasAfterSessionResume() throws Exception {
194194
* streaming_fidelity/should_not_produce_deltas_after_session_resume_with_streaming_disabled
195195
*/
196196
@Test
197-
@Disabled("Passes in isolation but times out in full suite due to test interaction (state leakage or process contention)")
197+
@Tag("isolated-resume")
198198
void testShouldNotProduceDeltasAfterSessionResumeWithStreamingDisabled() throws Exception {
199199
ctx.configureForTest("streaming_fidelity",
200200
"should_not_produce_deltas_after_session_resume_with_streaming_disabled");

0 commit comments

Comments
 (0)