diff options
| author | Taras Madan <tarasmadan@google.com> | 2025-05-15 15:01:02 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2025-05-19 09:39:47 +0000 |
| commit | 27f689959decd391b047c8034d481267d500549e (patch) | |
| tree | 79ce6364d592fd6841e25ec64ca645fc3c65cdcf /vm/vm_test.go | |
| parent | 8f9cf946b3733d0b4ad3124bce155a4fc3849c3a (diff) | |
vm: func Run accepts context
It allows to use context as a single termination signal source.
Diffstat (limited to 'vm/vm_test.go')
| -rw-r--r-- | vm/vm_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vm/vm_test.go b/vm/vm_test.go index 34b656799..f550cc89a 100644 --- a/vm/vm_test.go +++ b/vm/vm_test.go @@ -5,6 +5,7 @@ package vm import ( "bytes" + "context" "fmt" "testing" "time" @@ -49,7 +50,7 @@ func (inst *testInstance) Forward(port int) (string, error) { return "", nil } -func (inst *testInstance) Run(timeout time.Duration, stop <-chan bool, command string) ( +func (inst *testInstance) Run(ctx context.Context, command string) ( outc <-chan []byte, errc <-chan error, err error) { return inst.outc, inst.errc, nil } @@ -395,7 +396,7 @@ func testMonitorExecution(t *testing.T, test *Test) { test.BodyExecuting(testInst.outc, testInst.errc, inject) done <- true }() - _, rep, err := inst.Run(time.Second, reporter, "", opts...) + _, rep, err := inst.Run(context.Background(), reporter, "", opts...) if err != nil { t.Fatal(err) } |
