CI windows tests on have failed at various points with "WSARecv tcp [::1]:51033: i/o timeout", in test setup or during runs.
<http://reports.vapour.ws/releases/issue/560bfec0749a562d81ebf836>
FAIL: state_test.go:23: stateSuite.SetUpTest
...
[LOG] 0:07.593 INFO juju.mongo dialled mongo successfully on address "[::1]:50712"
[LOG] 0:26.352 DEBUG juju.apiserver -> [18] machine-0 21.0019446s {"RequestId":1,"Error":"WSARecv tcp [::1]:51033: i/o timeout","Response":"'body redacted'"} Admin[""].Login
state_test.go:24:
s.firewallerSuite.SetUpTest(c)
c:/users/admini~1/appdata/local/temp/tmp6pllox/gogo/src/github.com/juju/juju/juju/testing/conn.go:152:
c.Assert(err, jc.ErrorIsNil)
... value *errors.Err = &errors.Err{message:"", cause:(*params.Error)(0xc08433bc20), previous:(*params.Error)(0xc08433bc20), file:"github.com/juju/juju/api/state.go", line:79} ("WSARecv tcp [::1]:51033: i/o timeout")
... error stack:
WSARecv tcp [::1]:51033: i/o timeout
github.com/juju/juju/api/state.go:79:
Does not seem to be tied to a particular revision, but another general symptom of illness like connection shutdown panics.
There is quite a lot of fail in the unit tests, and a bit in the production code too.
Many of the unit tests are using the timeout defaults that we use in the production code. A couple of years ago we had changed the tests to use test-specific timeouts because I/O timeouts happen in CI, but apparently that got lost somewhere along the way.
The production code has an issue also: the "state. State.ForModel" method dials with the default mongo dial options rather than with the same options you used to open state in the first place.
I'll put some test-specifics in a central spot and make sure we're using them everywhere.