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
29 changes: 29 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,7 @@ var implementedEffectProbes = map[string]string{
"protoTasks.maxPerRequestor": "TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment",
"protoTasks.perMinute": "TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment",
"events.history": "TestEventsHistoryBoundsTheReplay",
"autostart.pollInterval": "TestAutostartPollIntervalPacesTheReadinessPollFromTheEnvironment",
"daemon.leaseTTL": "TestDaemonLeaseTTLForgetsASilentCallerFromTheEnvironment",
"elicit.disambiguate": "TestElicitDisambiguateAsksWhichInstanceFromTheEnvironment",
"elicit.disambiguateDefault": "TestElicitDisambiguateDefaultPicksTheRecentInstanceFromTheEnvironment",
Expand Down Expand Up @@ -282,6 +283,7 @@ var effectProbeFuncs = map[string]func(*testing.T){
"TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment": TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment,
"TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment": TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment,
"TestEventsHistoryBoundsTheReplay": TestEventsHistoryBoundsTheReplay,
"TestAutostartPollIntervalPacesTheReadinessPollFromTheEnvironment": TestAutostartPollIntervalPacesTheReadinessPollFromTheEnvironment,
"TestDaemonLeaseTTLForgetsASilentCallerFromTheEnvironment": TestDaemonLeaseTTLForgetsASilentCallerFromTheEnvironment,
"TestElicitDisambiguateAsksWhichInstanceFromTheEnvironment": TestElicitDisambiguateAsksWhichInstanceFromTheEnvironment,
"TestElicitDisambiguateDefaultPicksTheRecentInstanceFromTheEnvironment": TestElicitDisambiguateDefaultPicksTheRecentInstanceFromTheEnvironment,
Expand Down Expand Up @@ -3731,6 +3733,33 @@ func TestDaemonLeaseTTLForgetsASilentCallerFromTheEnvironment(t *testing.T) {
}
}

// autostartTook times the first ls in a fresh environment, which starts
// the daemon and polls until it answers. Warming is off so the time is
// the start and nothing else.
func autostartTook(t *testing.T, env ...string) time.Duration {
t.Helper()
e := newEnv(t, oneServer)
e.setenv(append([]string{"MCPX_DAEMON_WARM=false"}, env...)...)
start := time.Now()
e.run("ls")
return time.Since(start)
}

// TestAutostartPollIntervalPacesTheReadinessPollFromTheEnvironment is
// the effect probe for autostart.pollInterval. A freshly spawned daemon
// never answers the very first ping, so the client waits one interval
// before its next: well under a second by default, at least 4s with
// autostart.pollInterval=4s.
func TestAutostartPollIntervalPacesTheReadinessPollFromTheEnvironment(t *testing.T) {
fast := autostartTook(t)
if fast >= 3*time.Second {
t.Fatalf("oracle: a default autostart should take well under 3s, took %v", fast)
}
if slow := autostartTook(t, "MCPX_AUTOSTART_POLL_INTERVAL=4s"); slow < 4*time.Second {
t.Fatalf("with autostart.pollInterval=4s the autostart should wait at least one 4s interval, took %v", slow)
}
}

// 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
1 change: 0 additions & 1 deletion pkgs/mcpx/internal/e2e/feature_coverage_exemptions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ setting prompt.maxTokens no integration-test exercise yet; burn-down #8471 (sett
setting prompt.runTimeout no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test
setting prompt.sample no integration-test exercise yet; burn-down #8471 (settings model-ai family); needs an EffectProbes entry + e2e test
setting prompt.sampleTimeout no integration-test exercise yet; burn-down #8471 (settings model-ai family); 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 events.reconnect 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
Expand Down
Loading