From db71ae66460a04c3f3c9b9228bd20a331ef70ac0 Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Thu, 5 Nov 2020 18:28:22 +1100 Subject: [PATCH] windows/svc/mgr: rename service in TestMyService TestMyService uses the same service name as service in golang.org/x/sys/windows/svc.TestExample. https://build.golang.org sometimes schedules TestMyService and TestExample to run at the same time. If that happens, tests fail, because they were not designed to run in parallel. This CL renames service in TestMyService, so it does not clash with TestExample. Fixes golang/go#42211 Change-Id: I928c2ebbae77de3540f5ce16948fb96eeeed836d Reviewed-on: https://go-review.googlesource.com/c/sys/+/267604 Run-TryBot: Alex Brainman TryBot-Result: Go Bot Trust: Alex Brainman Reviewed-by: Ian Lance Taylor --- windows/svc/mgr/mgr_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/windows/svc/mgr/mgr_test.go b/windows/svc/mgr/mgr_test.go index 750ffe89..7035db2a 100644 --- a/windows/svc/mgr/mgr_test.go +++ b/windows/svc/mgr/mgr_test.go @@ -7,6 +7,7 @@ package mgr_test import ( + "fmt" "os" "path/filepath" "sort" @@ -217,7 +218,7 @@ func TestMyService(t *testing.T) { t.Skip("skipping test in short mode - it modifies system services") } - const name = "myservice" + const name = "mymgrservice" m, err := mgr.Connect() if err != nil { @@ -285,9 +286,9 @@ func TestMyService(t *testing.T) { } testSetRecoveryActions(t, s) - testRebootMessage(t, s, "myservice failed") + testRebootMessage(t, s, fmt.Sprintf("%s failed", name)) testRebootMessage(t, s, "") // delete reboot message - testRecoveryCommand(t, s, "sc query myservice") + testRecoveryCommand(t, s, fmt.Sprintf("sc query %s", name)) testRecoveryCommand(t, s, "") // delete recovery command remove(t, s)