Commit d9e44b56 authored by Adrian Sutton's avatar Adrian Sutton

op-e2e: Wait for external clients to terminate after Kill()

Otherwise the client may write to a directory the test tries to delete causing failures.
parent bb83c60c
...@@ -2,6 +2,7 @@ package op_e2e ...@@ -2,6 +2,7 @@ package op_e2e
import ( import (
"encoding/json" "encoding/json"
"errors"
"math/big" "math/big"
"os" "os"
"os/exec" "os/exec"
...@@ -51,6 +52,11 @@ func (eec *ExternalEthClient) Close() error { ...@@ -51,6 +52,11 @@ func (eec *ExternalEthClient) Close() error {
select { select {
case <-time.After(5 * time.Second): case <-time.After(5 * time.Second):
eec.Session.Kill() eec.Session.Kill()
select {
case <-time.After(30 * time.Second):
return errors.New("external client failed to terminate")
case <-eec.Session.Exited:
}
case <-eec.Session.Exited: case <-eec.Session.Exited:
} }
return nil return nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment