Skip to content

Commit

Permalink
workaround 'Network is unreachable' errors in new CI (#353)
Browse files Browse the repository at this point in the history
Motivation:

In the new CI, ChannelTests.testGeneralConnectTimeout often fails with

```
error: ChannelTests.testGeneralConnectTimeout : threw error "connection reset (error set): Network is unreachable (errno: 101) "
```

It's not a great test but this just works around it by saying that if
the network's down that's fine too.

Modifications:

also accept ENETDOWN and ENETUNREACH

Result:

tests should pass in new CI.
  • Loading branch information
weissi authored Apr 25, 2018
1 parent bc61e6a commit fadbba8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/NIOTests/ChannelTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,10 @@ public class ChannelTests: XCTestCase {
} else {
XCTFail()
}
} catch let err as IOError where err.errnoCode == ENETDOWN || err.errnoCode == ENETUNREACH {
// we need to accept those too unfortunately
} catch {
XCTFail("unexpected error \(error)")
}
}

Expand All @@ -1094,6 +1098,10 @@ public class ChannelTests: XCTestCase {
} else {
XCTFail()
}
} catch let err as IOError where err.errnoCode == ENETDOWN || err.errnoCode == ENETUNREACH {
// we need to accept those too unfortunately
} catch {
XCTFail("unexpected error \(error)")
}
}

Expand Down

0 comments on commit fadbba8

Please sign in to comment.