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 77 "testing"
88
99 "context"
10+ "errors"
1011 "os"
12+ "runtime"
1113 "sync"
1214 "time"
1315)
@@ -28,7 +30,11 @@ func TestReadDeadline(t *testing.T) {
2830
2931 err := ptmx .SetDeadline (time .Now ().Add (timeout / 10 ))
3032 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+ }
3238 }
3339
3440 var buf = make ([]byte , 1 )
@@ -80,6 +86,7 @@ func prepare(t *testing.T) (ptmx *os.File, done func()) {
8086 t .Cleanup (func () { _ = pts .Close () })
8187
8288 ctx , done := context .WithCancel (context .Background ())
89+ t .Cleanup (done )
8390 go func () {
8491 select {
8592 case <- ctx .Done ():
You can’t perform that action at this time.
0 commit comments