Skip to content
Merged
Show file tree
Hide file tree
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
34 changes: 34 additions & 0 deletions pkgs/mcpx/internal/e2e/effect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ var implementedEffectProbes = map[string]string{
"protoTasks.maxPerRequestor": "TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment",
"protoTasks.perMinute": "TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment",
"events.history": "TestEventsHistoryBoundsTheReplay",
"doctor.timeout": "TestDoctorTimeoutBoundsTheDaemonCheck",
"registry.timeout": "TestRegistryTimeoutBoundsARegistryRequest",
"completion.maxValues": "TestCompletionMaxValuesCapsTheValues",
"catalog.instructions": "TestCatalogInstructionsShowsServerGuidance",
"plumbing.launcherPlaceholderRepeat": "TestPlumbingLauncherPlaceholderRepeatAllowsATwiceUsedName",
Expand Down Expand Up @@ -241,6 +243,8 @@ var effectProbeFuncs = map[string]func(*testing.T){
"TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment": TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment,
"TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment": TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment,
"TestEventsHistoryBoundsTheReplay": TestEventsHistoryBoundsTheReplay,
"TestDoctorTimeoutBoundsTheDaemonCheck": TestDoctorTimeoutBoundsTheDaemonCheck,
"TestRegistryTimeoutBoundsARegistryRequest": TestRegistryTimeoutBoundsARegistryRequest,
"TestCompletionMaxValuesCapsTheValues": TestCompletionMaxValuesCapsTheValues,
"TestCatalogInstructionsShowsServerGuidance": TestCatalogInstructionsShowsServerGuidance,
"TestPlumbingLauncherPlaceholderRepeatAllowsATwiceUsedName": TestPlumbingLauncherPlaceholderRepeatAllowsATwiceUsedName,
Expand Down Expand Up @@ -2679,6 +2683,36 @@ func TestCompletionMaxValuesCapsTheValues(t *testing.T) {
}
}

// TestDoctorTimeoutBoundsTheDaemonCheck is the effect probe for
// doctor.timeout: `mcpx doctor` reaches the daemon at the default bound, and
// a one-nanosecond bound fails the connection check before it can.
func TestDoctorTimeoutBoundsTheDaemonCheck(t *testing.T) {
e := newEnv(t, oneServer)
if out, err := e.try("doctor"); err != nil {
t.Errorf("at the default doctor.timeout the daemon should be reached (err %v):\n%s", err, out)
}
e2 := newEnv(t, oneServer)
e2.setenv("MCPX_DOCTOR_TIMEOUT=1ns")
if out, err := e2.try("doctor"); err == nil || !strings.Contains(out, "deadline exceeded") {
t.Errorf("doctor.timeout=1ns should fail the connection check on its deadline (err %v):\n%s", err, out)
}
}

// TestRegistryTimeoutBoundsARegistryRequest is the effect probe for
// registry.timeout: a search against the stub registry answers at the
// default bound, and a one-nanosecond bound cuts it off.
func TestRegistryTimeoutBoundsARegistryRequest(t *testing.T) {
e := newEnv(t, oneServer)
if out, err := e.try("registry", "search", "demo"); err != nil || !strings.Contains(out, "a stub entry") {
t.Errorf("at the default registry.timeout the stub should answer (err %v):\n%s", err, out)
}
e2 := newEnv(t, oneServer)
e2.setenv("MCPX_REGISTRY_TIMEOUT=1ns")
if out, err := e2.try("registry", "search", "demo"); err == nil || strings.Contains(out, "a stub entry") {
t.Errorf("registry.timeout=1ns should cut the search off (err %v):\n%s", err, out)
}
}

// TestDaemonAddressIsReachableFromTheEnvironment is the effect probe
// for daemon.address (#8468 chain 1). The exemption it replaced said
// a bind address is a network identity the harness cannot vary
Expand Down
2 changes: 0 additions & 2 deletions pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,9 @@ setting autostart.logTail no integration-test exercise yet; burn-down #8470 (set
setting autostart.pingTimeout no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
setting autostart.pollInterval no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
setting deps.autoInstall no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
setting doctor.timeout no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
setting events.reconnect no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
setting hooks.autonomy no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
setting policy.write no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
setting registry.timeout no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
setting repair.autonomy no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
setting retention.stickyWindow no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
setting sampling.answerLocally no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
Expand Down
Loading