Fix invalid interface conversion in runner

panic: interface conversion: interface {} is syscall.WaitStatus, not unix.WaitStatus

goroutine 1 [running]:
main.runTestCaseNative(0xc0001fc000, 0xe3, 0xc000119b60, 0x1, 0x1, 0x0, 0x0)
	test/runner/runner.go:185 +0xa94
main.main()
	test/runner/runner.go:118 +0x745

PiperOrigin-RevId: 361957796
This commit is contained in:
Fabricio Voznika
2021-03-09 20:12:20 -08:00
committed by gVisor bot
parent 2a888a106d
commit e0e04814b4
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -275,7 +275,7 @@ func MaybeRunAsRoot() error {
}()
if err := cmd.Wait(); err != nil {
if exit, ok := err.(*exec.ExitError); ok {
if ws, ok := exit.Sys().(unix.WaitStatus); ok {
if ws, ok := exit.Sys().(syscall.WaitStatus); ok {
os.Exit(ws.ExitStatus())
}
log.Warningf("No wait status provided, exiting with -1: %v", err)
+1 -1
View File
@@ -182,7 +182,7 @@ func runTestCaseNative(testBin string, args []string) error {
}
if err := cmd.Run(); err != nil {
ws := err.(*exec.ExitError).Sys().(unix.WaitStatus)
ws := err.(*exec.ExitError).Sys().(syscall.WaitStatus)
return fmt.Errorf("test exited with status %d, want 0", ws.ExitStatus())
}
return nil