lang: Add a test timeout to catch blocked cases
This should catch any blocked tests and report an error. The timeout is arbitrary.
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
|||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/purpleidea/mgmt/engine"
|
"github.com/purpleidea/mgmt/engine"
|
||||||
"github.com/purpleidea/mgmt/engine/graph/autoedge"
|
"github.com/purpleidea/mgmt/engine/graph/autoedge"
|
||||||
@@ -1504,6 +1505,11 @@ func TestAstFunc2(t *testing.T) {
|
|||||||
t.Errorf("test #%d: stream errored: %+v", index, err)
|
t.Errorf("test #%d: stream errored: %+v", index, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case <-time.After(60 * time.Second): // blocked functions
|
||||||
|
t.Errorf("test #%d: FAIL", index)
|
||||||
|
t.Errorf("test #%d: stream timeout", index)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// run interpret!
|
// run interpret!
|
||||||
|
|||||||
Reference in New Issue
Block a user