Skip to content

Fix testResumeSessionWithNewClient by keeping first client alive during session resume#5

Merged
brunoborges merged 2 commits intomainfrom
copilot/fix-github-actions-workflow
Jan 29, 2026
Merged

Fix testResumeSessionWithNewClient by keeping first client alive during session resume#5
brunoborges merged 2 commits intomainfrom
copilot/fix-github-actions-workflow

Conversation

Copy link
Contributor

Copilot AI commented Jan 29, 2026

The testResumeSessionWithNewClient test was failing with "Session not found" because client1 closed before client2 attempted to resume the session. When client1's try-with-resources block exited, it killed the CLI process, destroying the session.

Changes

  • Nested client2's try-with-resources block inside client1's block
  • Both CLI processes now remain active during session resumption
  • Aligns with Node.js and Go SDK test patterns

Before:

try (CopilotClient client1 = ctx.createClient()) {
    CopilotSession session1 = client1.createSession().get();
    sessionId = session1.getSessionId();
    // ... use session
}  // client1 closes here, killing CLI process and destroying session

try (CopilotClient client2 = ctx.createClient()) {
    CopilotSession session2 = client2.resumeSession(sessionId).get();  // Fails: Session not found
}

After:

try (CopilotClient client1 = ctx.createClient()) {
    CopilotSession session1 = client1.createSession().get();
    sessionId = session1.getSessionId();
    // ... use session
    
    try (CopilotClient client2 = ctx.createClient()) {
        CopilotSession session2 = client2.resumeSession(sessionId).get();  // Works: session still exists
    }
}  // Both clients close after session resumption completes

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkstyle.org
    • Triggering command: /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/tools/linux64/java/bin/java /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/tools/linux64/java/bin/java -jar /opt/hostedtoolcache/CodeQL/2.24.0/x64/codeql/xml/tools/xml-extractor.jar --fileList=/home/REDACTED/work/copilot-sdk-java/.codeql-scratch/dbs/java/working/files-to-index18304746519990065774.list --sourceArchiveDir=/home/REDACTED/work/copilot-sdk-java/.codeql-scratch/dbs/java/src --outputDir=/home/REDACTED/work/copilot-sdk-java/.codeql-scratch/dbs/java/trap/java (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Fix the failing GitHub Actions workflow Java SDK Tests
Analyze the workflow logs, identify the root cause of the failure, and implement a fix.
Job ID: 61897996428
Job URL: https://github.com/copilot-community-sdk/copilot-sdk-java/actions/runs/21486746051/job/61897996428


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix the failing GitHub Actions workflow for Java SDK tests Fix testResumeSessionWithNewClient by keeping first client alive during session resume Jan 29, 2026
Copilot AI requested a review from brunoborges January 29, 2026 17:07
@brunoborges brunoborges marked this pull request as ready for review January 29, 2026 18:07
@brunoborges brunoborges merged commit 75e6968 into main Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants