File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 7
7
"testing"
8
8
9
9
"context"
10
+ "errors"
10
11
"os"
12
+ "runtime"
11
13
"sync"
12
14
"time"
13
15
)
@@ -28,7 +30,11 @@ func TestReadDeadline(t *testing.T) {
28
30
29
31
err := ptmx .SetDeadline (time .Now ().Add (timeout / 10 ))
30
32
if err != nil {
31
- t .Fatalf ("error: set deadline: %v\n " , err )
33
+ if errors .Is (err , os .ErrNoDeadline ) {
34
+ t .Skipf ("deadline is not supported on %s/%s" , runtime .GOOS , runtime .GOARCH )
35
+ } else {
36
+ t .Fatalf ("error: set deadline: %v\n " , err )
37
+ }
32
38
}
33
39
34
40
var buf = make ([]byte , 1 )
@@ -80,6 +86,7 @@ func prepare(t *testing.T) (ptmx *os.File, done func()) {
80
86
t .Cleanup (func () { _ = pts .Close () })
81
87
82
88
ctx , done := context .WithCancel (context .Background ())
89
+ t .Cleanup (done )
83
90
go func () {
84
91
select {
85
92
case <- ctx .Done ():
You can’t perform that action at this time.
0 commit comments