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
28 changes: 28 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",
"daemon.idleExit": "TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment",
"daemon.port": "TestDaemonPortBindsTheChosenPortFromTheEnvironment",
"daemon.saveInterval": "TestDaemonSaveIntervalWritesTheLeaseTableFromTheEnvironment",
"autostart.pollInterval": "TestAutostartPollIntervalPacesTheReadinessPollFromTheEnvironment",
Expand Down Expand Up @@ -286,6 +287,7 @@ var effectProbeFuncs = map[string]func(*testing.T){
"TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment": TestProtoTasksMaxPerRequestorCapsUnfinishedTasksFromTheEnvironment,
"TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment": TestProtoTasksPerMinuteWindowsTaskReadsFromTheEnvironment,
"TestEventsHistoryBoundsTheReplay": TestEventsHistoryBoundsTheReplay,
"TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment": TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment,
"TestDaemonPortBindsTheChosenPortFromTheEnvironment": TestDaemonPortBindsTheChosenPortFromTheEnvironment,
"TestDaemonSaveIntervalWritesTheLeaseTableFromTheEnvironment": TestDaemonSaveIntervalWritesTheLeaseTableFromTheEnvironment,
"TestAutostartPollIntervalPacesTheReadinessPollFromTheEnvironment": TestAutostartPollIntervalPacesTheReadinessPollFromTheEnvironment,
Expand Down Expand Up @@ -3838,6 +3840,32 @@ func TestDaemonPortBindsTheChosenPortFromTheEnvironment(t *testing.T) {
}
}

// TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment is the effect
// probe for daemon.idleExit, the daemon's own idle bound (the one a
// daemon started without --idle-exit uses). autostart.idleExit is
// zeroed so the auto-started daemon gets no flag, and instances are
// reaped after 200ms. With daemon.idleExit at its 0s default the daemon
// never exits, so ls with autostart off reaches it 4s later; with
// daemon.idleExit=1s it has exited, and the same ls fails.
func TestDaemonIdleExitStopsAnIdleDaemonFromTheEnvironment(t *testing.T) {
stillThere := func(extra ...string) bool {
e := newEnv(t, oneServer)
e.setenv(append([]string{"MCPX_AUTOSTART_IDLE_EXIT=0s",
"MCPX_POOL_IDLE_TIMEOUT=200ms", "MCPX_DAEMON_REAP_INTERVAL=100ms"}, extra...)...)
e.run("ls")
time.Sleep(4 * time.Second)
e.setenv("MCPX_DAEMON_AUTOSTART=false")
_, err := e.try("ls")
return err == nil
}
if !stillThere() {
t.Fatalf("oracle: with no idle bound the daemon should still be running")
}
if stillThere("MCPX_DAEMON_IDLE_EXIT=1s") {
t.Fatalf("with daemon.idleExit=1s the idle daemon should have exited")
}
}

// 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 @@ -18,7 +18,6 @@ cli reload no integration-test exercise yet; burn-down #8461 (cli daemon group)
cli stdio-proxy no integration-test exercise yet; burn-down #8461 (cli daemon group)
cli supervise no integration-test exercise yet; burn-down #8461 (cli daemon group)
cli upgrade no integration-test exercise yet; burn-down #8461 (cli daemon group)
setting daemon.idleExit no integration-test exercise yet; burn-down #8468 (settings daemon family); needs an EffectProbes entry + e2e test
setting daemon.inlineStartPoll no integration-test exercise yet; burn-down #8468 (settings daemon family); needs an EffectProbes entry + e2e test
setting daemon.roots no integration-test exercise yet; burn-down #8468 (settings daemon family); needs an EffectProbes entry + e2e test
setting daemon.socketProbeTimeout no integration-test exercise yet; burn-down #8468 (settings daemon family); needs an EffectProbes entry + e2e test
Expand Down
Loading