From 4f8d1f5c46f70922f1b07233a34bd2d2083562c6 Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 23 Dec 2025 13:38:42 -0500 Subject: [PATCH 1/3] Still try to cleanup service in TestSingleSvc on Windows. --- cmd/state-svc/test/integration/svc_int_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/state-svc/test/integration/svc_int_test.go b/cmd/state-svc/test/integration/svc_int_test.go index d00cfa25f6..c01f623706 100644 --- a/cmd/state-svc/test/integration/svc_int_test.go +++ b/cmd/state-svc/test/integration/svc_int_test.go @@ -157,9 +157,15 @@ func (suite *SvcIntegrationTestSuite) TestStartDuplicateErrorOutput() { func (suite *SvcIntegrationTestSuite) TestSingleSvc() { suite.OnlyRunForTags(tagsuite.Service) ts := e2e.New(suite.T(), false) - // TODO: CP-1268 should remove this conditional. + // TODO: CP-1268 should remove this conditional and just keep the defer. if runtime.GOOS != "windows" || !condition.OnCI() { defer ts.Close() + } else { + defer func() { + cp := ts.SpawnCmd(ts.SvcExe, "stop") + time.Sleep(500 * time.Millisecond) + cp.SendCtrlC() // if this ends up as a foreground process, then try to halt it + }() } ts.SpawnCmdWithOpts(ts.SvcExe, e2e.OptArgs("stop")) From ed8a2870cff1ef7ffeaa966ea3a04401d830ee27 Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 23 Dec 2025 16:13:53 -0500 Subject: [PATCH 2/3] Disable svc warning. This may have something to do with failing activate integration tests involving state-svc not stopping. --- cmd/state-svc/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/state-svc/main.go b/cmd/state-svc/main.go index 779944601b..0563b3510b 100644 --- a/cmd/state-svc/main.go +++ b/cmd/state-svc/main.go @@ -55,7 +55,7 @@ func main() { } if err := events.WaitForEvents(5*time.Second, rollbar.Wait, authentication.LegacyClose, logging.Close); err != nil { - fmt.Fprintf(os.Stderr, "Warning: failed to wait for events") + //fmt.Fprintf(os.Stderr, "Warning: failed to wait for events") } os.Exit(exitCode) }() From 023b8deebd4f3f2e9cadab2ada3e6c029930138c Mon Sep 17 00:00:00 2001 From: mitchell Date: Tue, 23 Dec 2025 16:26:31 -0500 Subject: [PATCH 3/3] Test --- cmd/state-svc/test/integration/svc_int_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/state-svc/test/integration/svc_int_test.go b/cmd/state-svc/test/integration/svc_int_test.go index c01f623706..cb182b60de 100644 --- a/cmd/state-svc/test/integration/svc_int_test.go +++ b/cmd/state-svc/test/integration/svc_int_test.go @@ -158,14 +158,14 @@ func (suite *SvcIntegrationTestSuite) TestSingleSvc() { suite.OnlyRunForTags(tagsuite.Service) ts := e2e.New(suite.T(), false) // TODO: CP-1268 should remove this conditional and just keep the defer. - if runtime.GOOS != "windows" || !condition.OnCI() { + //if runtime.GOOS != "windows" || !condition.OnCI() { defer ts.Close() - } else { - defer func() { - cp := ts.SpawnCmd(ts.SvcExe, "stop") - time.Sleep(500 * time.Millisecond) - cp.SendCtrlC() // if this ends up as a foreground process, then try to halt it - }() + //} else { + // defer func() { + // cp := ts.SpawnCmd(ts.SvcExe, "stop") + // time.Sleep(500 * time.Millisecond) + // cp.SendCtrlC() // if this ends up as a foreground process, then try to halt it + // }() } ts.SpawnCmdWithOpts(ts.SvcExe, e2e.OptArgs("stop"))