Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions pkgs/mcpx/internal/cli/ensuredaemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,14 @@ func TestEnsureDaemonNeverReadyStillTimesOut(t *testing.T) {
t.Fatal("the fake daemon was never spawned")
}
}

// A cancelled context against a remote endpoint reports the cancellation,
// not the generic "no daemon there" error.
func TestEnsureDaemonRemoteCancelledContext(t *testing.T) {
c := NewClientAt(daemon.Paths{}, "", "http://127.0.0.1:1")
ctx, cancel := context.WithCancel(context.Background())
cancel()
if err := c.EnsureDaemon(ctx); !errors.Is(err, context.Canceled) {
t.Fatalf("EnsureDaemon(remote, cancelled ctx) = %v, want context.Canceled", err)
}
}
Loading