File tree Expand file tree Collapse file tree
src/test/java/com/github/copilot/sdk Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,12 +289,34 @@ public String getProxyUrl() {
289289 }
290290
291291 /**
292- * Checks if the proxy process is still alive.
292+ * Checks if the proxy process is still alive and responsive. This does both a
293+ * process alive check AND an HTTP health check.
293294 *
294- * @return true if the proxy is running, false otherwise
295+ * @return true if the proxy is running and responsive , false otherwise
295296 */
296297 public boolean isAlive () {
297- return process != null && process .isAlive ();
298+ if (process == null || !process .isAlive ()) {
299+ return false ;
300+ }
301+
302+ // Also verify the proxy is responsive via HTTP
303+ if (proxyUrl != null ) {
304+ try {
305+ java .net .HttpURLConnection conn = (java .net .HttpURLConnection ) new java .net .URL (proxyUrl + "/exchanges" )
306+ .openConnection ();
307+ conn .setRequestMethod ("GET" );
308+ conn .setConnectTimeout (1000 );
309+ conn .setReadTimeout (1000 );
310+ int responseCode = conn .getResponseCode ();
311+ conn .disconnect ();
312+ return responseCode == 200 ;
313+ } catch (Exception e ) {
314+ // If HTTP check fails, the proxy is not responsive
315+ return false ;
316+ }
317+ }
318+
319+ return true ;
298320 }
299321
300322 /**
Original file line number Diff line number Diff line change 1919import org .junit .jupiter .api .AfterAll ;
2020import org .junit .jupiter .api .BeforeAll ;
2121import org .junit .jupiter .api .Test ;
22- import org .junit .jupiter .api .condition .DisabledIfEnvironmentVariable ;
2322
2423import com .github .copilot .sdk .events .AbstractSessionEvent ;
2524import com .github .copilot .sdk .events .AbortEvent ;
@@ -487,12 +486,9 @@ void testCreateSessionWithCustomConfigDir() throws Exception {
487486 }
488487 }
489488
490- // Skip in CI - this test validates client-side timeout behavior, not LLM
491- // responses.
492- // The test intentionally times out before receiving a response, so there's no
493- // snapshot to replay.
489+ // This test validates client-side timeout behavior. The snapshot has no
490+ // assistant response because the test expects timeout BEFORE completion.
494491 @ Test
495- @ DisabledIfEnvironmentVariable (named = "CI" , matches = ".*" )
496492 void testSendAndWaitThrowsOnTimeout () throws Exception {
497493 ctx .configureForTest ("session" , "sendandwait_throws_on_timeout" );
498494
You can’t perform that action at this time.
0 commit comments