Track Task State in the client and capture Wait results

This commit is contained in:
Alex Dadgar
2015-11-13 22:07:13 -08:00
parent 9681d09d56
commit f4b461f97a
26 changed files with 418 additions and 336 deletions

View File

@@ -118,9 +118,9 @@ func TestJavaDriver_Start_Wait(t *testing.T) {
// Task should terminate quickly
select {
case err := <-handle.WaitCh():
if err != nil {
t.Fatalf("err: %v", err)
case res := <-handle.WaitCh():
if !res.Successful() {
t.Fatalf("err: %v", res)
}
case <-time.After(2 * time.Second):
// expect the timeout b/c it's a long lived process
@@ -171,8 +171,8 @@ func TestJavaDriver_Start_Kill_Wait(t *testing.T) {
// Task should terminate quickly
select {
case err := <-handle.WaitCh():
if err == nil {
case res := <-handle.WaitCh():
if res.Successful() {
t.Fatal("should err")
}
case <-time.After(8 * time.Second):