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 <alex.brainman@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Alex Brainman
2020-11-05 18:28:22 +11:00
parent 1dbcb44a4e
commit db71ae6646

View File

@@ -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)