mirror of
https://github.com/golang/sys.git
synced 2026-02-08 03:36:03 +03:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user