workaround 'Network is unreachable' errors in new CI (#353)

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.
This commit is contained in:
Johannes Weiß 2018-04-25 15:09:26 +01:00 committed by GitHub
parent bc61e6a815
commit fadbba8a5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -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)")
}
}
@ -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)")
}
}