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
27 changes: 27 additions & 0 deletions pkgs/mcpx/internal/e2e/effect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ var implementedEffectProbes = map[string]string{
"protoTasks.maxPerRequestor": "TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment",
"protoTasks.perMinute": "TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment",
"events.history": "TestEventsHistoryBoundsTheReplay",
"session.releaseTimeout": "TestSessionReleaseTimeoutBoundsTheEndOfRunReleaseFromTheEnvironment",
"daemon.idleExit": "TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment",
"daemon.port": "TestDaemonPortBindsTheChosenPortFromTheEnvironment",
"daemon.saveInterval": "TestDaemonSaveIntervalWritesTheLeaseTableFromTheEnvironment",
Expand Down Expand Up @@ -287,6 +288,7 @@ var effectProbeFuncs = map[string]func(*testing.T){
"TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment": TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment,
"TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment": TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment,
"TestEventsHistoryBoundsTheReplay": TestEventsHistoryBoundsTheReplay,
"TestSessionReleaseTimeoutBoundsTheEndOfRunReleaseFromTheEnvironment": TestSessionReleaseTimeoutBoundsTheEndOfRunReleaseFromTheEnvironment,
"TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment": TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment,
"TestDaemonPortBindsTheChosenPortFromTheEnvironment": TestDaemonPortBindsTheChosenPortFromTheEnvironment,
"TestDaemonSaveIntervalWritesTheLeaseTableFromTheEnvironment": TestDaemonSaveIntervalWritesTheLeaseTableFromTheEnvironment,
Expand Down Expand Up @@ -3866,6 +3868,31 @@ func TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment(t *testing.T) {
}
}

// liveAfterAnExec runs a script that calls a session-scoped exclusive
// demo once, then returns ls's LIVE column for demo.
func liveAfterAnExec(t *testing.T, env ...string) string {
t.Helper()
e := newEnv(t, `{"mcpServers":{"demo":{"command":"FAKE","mcpx":{"sharing":"exclusive","scope":"session","max":4}}}}`)
e.setenv(append([]string{"MCPX_DAEMON_WARM=false"}, env...)...)
e.run("exec", `await demo.echo({ message: "x" });`)
return lsDemoRow(t, e.run("ls"))[4]
}

// TestSessionReleaseTimeoutBoundsTheEndOfRunReleaseFromTheEnvironment is
// the effect probe for session.releaseTimeout. When a script ends, exec
// asks the daemon to release the instances its ephemeral session leased.
// Within the default bound the release lands and nothing is left live;
// with session.releaseTimeout=1ns the request cannot complete, so the
// script's instance is still running afterwards.
func TestSessionReleaseTimeoutBoundsTheEndOfRunReleaseFromTheEnvironment(t *testing.T) {
if live := liveAfterAnExec(t); live != "0" {
t.Fatalf("oracle: by default the script's instance should be released when it ends, LIVE=%s", live)
}
if live := liveAfterAnExec(t, "MCPX_SESSION_RELEASE_TIMEOUT=1ns"); live != "1" {
t.Fatalf("with session.releaseTimeout=1ns the release should not land, leaving one instance, LIVE=%s", live)
}
}

// 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 @@ -79,4 +79,3 @@ setting events.reconnect no integration-test exercise yet; burn-down #8470 (sett
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
setting search.semantic no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
setting session.releaseTimeout no integration-test exercise yet; burn-down #8470 (settings long-tail families); needs an EffectProbes entry + e2e test
Loading