0054d4bd69
gates / gates (push) Successful in 27s
R-634: a whole-box backup no longer stops/restarts a DEPLOYING app (the measured cause of containers running under 'not deployed'); StopStack and StartStack refuse a deploying stack for every caller. R-625: held badge 'Stopped - restore needed', no Update button. R-636: kernel oom_kill counter; 20+ in 30 min -> one app_oom_storm. R-647: held error per reader, copy_holds key, two log wordings. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
37 lines
1.5 KiB
Go
37 lines
1.5 KiB
Go
package stacks
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
)
|
|
|
|
// R-634 (v0.265.0) — the backstop for every caller: a stop or a start while the deploy's own
|
|
// `compose up` is running is refused BEFORE any compose command.
|
|
//
|
|
// COMPANION RED-PROOF (REPORT.md): delete the Deploying check in StopStack — the stop falls through to
|
|
// `compose down` and the error is no longer ErrStackDeploying.
|
|
func TestR634_StopAndStartRefuseADeployingStack(t *testing.T) {
|
|
m, _, _, _ := newSlice4Manager(t)
|
|
// NEVER a real compose: the control below falls through to `compose down`, and the stack dir is
|
|
// named like a real app. An empty PATH + the v1 binary name guarantees the exec cannot find
|
|
// anything to run, on any machine this test runs on.
|
|
m.composeCmd = "docker-compose"
|
|
t.Setenv("PATH", t.TempDir())
|
|
m.mu.Lock()
|
|
m.stacks["nextcloud"].Deploying = true
|
|
m.mu.Unlock()
|
|
if err := m.StopStack("nextcloud"); !errors.Is(err, ErrStackDeploying) {
|
|
t.Fatalf("StopStack on a deploying stack = %v, want ErrStackDeploying", err)
|
|
}
|
|
if err := m.StartStack("nextcloud"); !errors.Is(err, ErrStackDeploying) {
|
|
t.Fatalf("StartStack on a deploying stack = %v, want ErrStackDeploying", err)
|
|
}
|
|
// Control: once the deploy is over, the same calls are not refused for THIS reason.
|
|
m.mu.Lock()
|
|
m.stacks["nextcloud"].Deploying = false
|
|
m.mu.Unlock()
|
|
if err := m.StopStack("nextcloud"); errors.Is(err, ErrStackDeploying) {
|
|
t.Fatal("control: a stack that is not deploying must not be refused as deploying")
|
|
}
|
|
}
|