wetware / pkg

Peer-to-peer cloud environment
https://wetware.run
Other
38 stars 7 forks source link

Transient failure of vat_test.TestServe #161

Closed lthibault closed 11 months ago

lthibault commented 11 months ago

vat/vat_test.go::TestServe fails transiently. I think this is probably a race between the client and server setup in the test. There's probably nothing to "fix" in the application code itself, as it's just reporting errors of the "network failed" kind.

Below are the two instances I've encountered so far.

Running tool: /usr/local/bin/go test -timeout 10s -run ^TestServe$ github.com/wetware/pkg/vat

2023/09/12 17:57:53 INFO wetware started ns=test peer=12D3KooWJQW94pqL9PSiiHvLTwrFVKwDBXEuDt46m68FDryWpkhK id=b201ca3ce64dd5c7
2023/09/12 17:57:54 WARN wetware started ns=test peer=12D3KooWJQW94pqL9PSiiHvLTwrFVKwDBXEuDt46m68FDryWpkhK id=b201ca3ce64dd5c7
2023-09-12T17:57:54.406-0400    ERROR   swarm2  swarm/swarm_listen.go:132   swarm listener for /inproc/~ accept error: closed
--- FAIL: TestServe (0.01s)
    --- FAIL: TestServe/clientThread (1.00s)
        /Users/lthibault/Go/src/github.com/wetware/pkg/vat/vat_test.go:86: 
                Error Trace:    /Users/lthibault/Go/src/github.com/wetware/pkg/vat/vat_test.go:86
                Error:          Received unexpected error:
                                core.capnp:Terminal.login: rpc: bootstrap: send message: transport: stream transport: send: encode: write pipe: stream reset
                Test:           TestServe/clientThread
FAIL
FAIL    github.com/wetware/pkg/vat  1.431s
FAIL
Running tool: /usr/local/bin/go test -timeout 10s -run ^TestServe$ github.com/wetware/pkg/vat

2023/09/12 18:19:04 INFO wetware started ns=test peer=12D3KooWJrXDMSpo7jXdtypaDp7uoh41vvycAkJW6eZmhW2ifk6f id=4c649b8dc118f966
2023/09/12 18:19:05 WARN wetware started ns=test peer=12D3KooWJrXDMSpo7jXdtypaDp7uoh41vvycAkJW6eZmhW2ifk6f id=4c649b8dc118f966
2023-09-12T18:19:05.319-0400    ERROR   swarm2  swarm/swarm_listen.go:132   swarm listener for /inproc/~ accept error: closed
--- FAIL: TestServe (0.01s)
    --- FAIL: TestServe/clientThread (0.01s)
        /Users/lthibault/Go/src/github.com/wetware/pkg/vat/vat_test.go:82: 
                Error Trace:    /Users/lthibault/Go/src/github.com/wetware/pkg/vat/vat_test.go:82
                Error:          Received unexpected error:
                                dial: failed to negotiate protocol: protocols not supported: [ww/0.1.0/test/packed ww/0.1.0/test]
                Test:           TestServe/clientThread
FAIL
FAIL    github.com/wetware/pkg/vat  1.408s
FAIL
lthibault commented 11 months ago

~Update: I've improved test synchronization and seem to reliably get the second failure (protocols not supported: ...) now.~

It's back now.

lthibault commented 11 months ago

Fixed in c269dbf05b6fa0397ce68a92c23f8388a9d4bed7