(t *testing.T)
| 1354 | } |
| 1355 | |
| 1356 | func 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 | |
| 1397 | func TestClient_MCPAuthInterestRegistration(t *testing.T) { |
| 1398 | t.Run("create skips MCP OAuth interest without auth handler", func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…