mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
shared/subprocess: Fix tests to use p.Wait() with context
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
This commit is contained in:
parent
02537fedc1
commit
4919fa47ed
@ -4,6 +4,7 @@
|
||||
package subprocess
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"os"
|
||||
"strings"
|
||||
@ -38,7 +39,7 @@ func TestSignalHandling(t *testing.T) {
|
||||
t.Error("Unable to Signal process: ", err)
|
||||
}
|
||||
|
||||
ecode, err := p.Wait()
|
||||
ecode, err := p.Wait(context.Background())
|
||||
if err == nil {
|
||||
t.Error("Did not exit with an error")
|
||||
} else if ecode != 1 {
|
||||
@ -119,7 +120,7 @@ func TestStopRestart(t *testing.T) {
|
||||
t.Error("Failed to restart process: ", err)
|
||||
}
|
||||
|
||||
exitcode, err := p.Wait()
|
||||
exitcode, err := p.Wait(context.Background())
|
||||
if err != nil {
|
||||
t.Error("Could not wait for process: ", err)
|
||||
} else if exitcode != 0 {
|
||||
@ -148,7 +149,7 @@ func TestProcessStartWaitExit(t *testing.T) {
|
||||
t.Error("Failed to start process: ", err)
|
||||
}
|
||||
|
||||
ecode, err := p.Wait()
|
||||
ecode, err := p.Wait(context.Background())
|
||||
if err == nil {
|
||||
t.Error("Did not exit with an error")
|
||||
} else if ecode != 1 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user