Skip to content

Commit 6d76d62

Browse files
committed
reexec: minor test fixes
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 469a746 commit 6d76d62

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

reexec/reexec_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ func init() {
3636
time.Sleep(1 * time.Second)
3737
os.Exit(0)
3838
})
39-
Init()
39+
if Init() {
40+
// Make sure we exit in case re-exec didn't os.Exit on its own.
41+
os.Exit(0)
42+
}
4043
}
4144

4245
func TestRegister(t *testing.T) {
@@ -199,7 +202,7 @@ func TestNaiveSelf(t *testing.T) {
199202
os.Exit(2)
200203
}
201204
cmd := exec.Command(naiveSelf(), "-test.run=TestNaiveSelf")
202-
cmd.Env = append(os.Environ(), "TEST_CHECK=1")
205+
cmd.Env = append(cmd.Environ(), "TEST_CHECK=1")
203206
err := cmd.Start()
204207
if err != nil {
205208
t.Fatalf("Unable to start command: %v", err)

0 commit comments

Comments
 (0)