MCPcopy Create free account
hub / github.com/github/copilot-sdk / TestClient_StartStopRace

Function TestClient_StartStopRace

go/client_test.go:1356–1395  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1354}
1355
1356func TestClient_StartStopRace(t *testing.T) {
1357 cliPath := findCLIPathForTest()
1358 if cliPath == "" {
1359 t.Skip("CLI not found")
1360 }
1361 client := NewClient(&ClientOptions{Connection: StdioConnection{Path: cliPath}})
1362 defer client.ForceStop()
1363 errChan := make(chan error)
1364 wg := sync.WaitGroup{}
1365 for range 10 {
1366 wg.Add(3)
1367 go func() {
1368 defer wg.Done()
1369 if err := client.Start(t.Context()); err != nil {
1370 select {
1371 case errChan <- err:
1372 default:
1373 }
1374 }
1375 }()
1376 go func() {
1377 defer wg.Done()
1378 if err := client.Stop(); err != nil {
1379 select {
1380 case errChan <- err:
1381 default:
1382 }
1383 }
1384 }()
1385 go func() {
1386 defer wg.Done()
1387 client.ForceStop()
1388 }()
1389 }
1390 wg.Wait()
1391 close(errChan)
1392 if err := <-errChan; err != nil {
1393 t.Fatal(err)
1394 }
1395}
1396
1397func TestClient_MCPAuthInterestRegistration(t *testing.T) {
1398 t.Run("create skips MCP OAuth interest without auth handler", func(t *testing.T) {

Callers

nothing calls this directly

Calls 8

ForceStopMethod · 0.95
StartMethod · 0.95
StopMethod · 0.95
findCLIPathForTestFunction · 0.85
NewClientFunction · 0.70
DoneMethod · 0.65
closeFunction · 0.50
AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…