Skip to content

Commit 470a211

Browse files
committed
Fix exitCode()
The exit code is in MSB. Not so sure why it was working on #330 itself's BuildKite check though. Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 7dbee2d commit 470a211

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

runtime/service_integ_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,9 @@ func TestUpdateVMMetadata_Isolated(t *testing.T) {
11071107

11081108
func exitCode(err *exec.ExitError) int {
11091109
if status, ok := err.Sys().(syscall.WaitStatus); ok {
1110-
return int(status)
1110+
// As like Go 1.12's ExitStatus and WEXITSTATUS()
1111+
// https://github.com/golang/go/blob/3bea90d84107889aaaaa0089f615d7070951a832/src/syscall/syscall_linux.go#L301
1112+
return (int(status) & 0xff00) >> 8
11111113
}
11121114
return -1
11131115
}

0 commit comments

Comments
 (0)