Skip to content

Instantly share code, notes, and snippets.

@dignifiedquire
Created January 22, 2017 15:55
Show Gist options
  • Select an option

  • Save dignifiedquire/c1916be23096ba4a30a84dc4a91b491a to your computer and use it in GitHub Desktop.

Select an option

Save dignifiedquire/c1916be23096ba4a30a84dc4a91b491a to your computer and use it in GitHub Desktop.
npm test
> [email protected] test /Users/dignifiedquire/opensource/ipfs/js-ipfs-lerna/packages/js-libp2p-swarm
> gulp test
[16:53:45] Using gulpfile ~/opensource/ipfs/js-ipfs-lerna/packages/js-libp2p-swarm/gulpfile.js
[16:53:45] Starting 'test'...
[16:53:45] Starting 'test:node'...
[16:53:45] Starting 'mocha'...
libp2p-swarm
create Swarm instance
✓ throws on missing peerInfo
transport - tcp
✓ add
✓ listen
✓ dial to a multiaddr
✓ dial to set of multiaddr, only one is available
✓ close (2006ms)
✓ support port 0
✓ support addr /ip4/0.0.0.0/tcp/9050
✓ support addr /ip4/0.0.0.0/tcp/0
✓ listen in several addrs
✓ handles EADDRINUSE error when trying to listen
transport - utp
- add
- listen
- dial
- close
transport - websockets
✓ add
✓ listen
✓ dial
✓ dial (conn from callback)
✓ close
stream muxing with multiplex (on TCP)
✓ add
✓ handle + dial on protocol (57ms)
✓ dial to warm conn
✓ dial on protocol, reuse warmed conn
1) enable identify to reuse incomming muxed conn
stream muxing with spdy (on TCP)
✓ add
✓ handle + dial on protocol (52ms)
✓ dial to warm conn
✓ dial on protocol, reuse warmed conn
✓ enable identify to reuse incomming muxed conn (519ms)
✓ with Identify, do getPeerInfo (517ms)
- make sure it does not blow up when the socket is closed
- blow up a socket, with WebSockets
✓ close one end, make sure the other does not blow (1010ms)
secio conn upgrade (on TCP)
✓ add
2) handle + dial on protocol
3) dial to warm conn
4) dial on protocol, reuse warmed conn
5) enable identify to reuse incomming muxed conn
✓ switch back to plaintext if no arguments passed in
tls conn upgrade (on TCP)
6) "after all" hook
- add
- dial
- tls on a muxed stream (not the full conn)
high level API - 1st without stream multiplexing (on TCP)
high level API - with everything mixed all together!
✓ handle a protocol
✓ dial on protocol
✓ dial on protocol
- add utp
✓ dial on protocol (returned conn)
✓ dial on protocol (returned conn)
✓ dial to warm a conn
✓ add spdy
✓ add spdy
- add multiplex
7) warm up from A to B on tcp to tcp+ws
8) warm up from A to B on tcp to tcp+ws
9) warm up a warmed up, from B to A
10) warm up a warmed up, from B to A
11) dial from tcp to tcp+ws, on protocol
12) dial from ws to ws no proto
13) dial from ws to ws
14) dial from tcp to tcp+ws (returned conn)
15) dial from tcp+ws to tcp+ws
37 passing (54s)
11 pending
15 failing
1) libp2p-swarm stream muxing with multiplex (on TCP) enable identify to reuse incomming muxed conn:
Uncaught AssertionError: expected 1 to equal 2
+ expected - actual
-1
+2
at Timeout.setTimeout [as _onTimeout] (test/04-muxing-multiplex.node.js:118:58)
2) libp2p-swarm secio conn upgrade (on TCP) handle + dial on protocol:
Uncaught TypeError: Cannot read property 'getRandomValues' of undefined
at Object.exports.randomBytes (node_modules/libp2p-secio/src/support.js:80:38)
at Object.exports.createProposal (node_modules/libp2p-secio/src/handshake/crypto.js:21:19)
at propose (node_modules/libp2p-secio/src/handshake/propose.js:18:31)
at series (node_modules/libp2p-secio/src/handshake/index.js:13:13)
at node_modules/async/internal/parallel.js:27:9
at replenish (node_modules/async/internal/eachOfLimit.js:64:17)
at node_modules/async/internal/eachOfLimit.js:68:9
at eachOfLimit (node_modules/async/eachOfLimit.js:37:36)
at node_modules/async/internal/doLimit.js:9:16
at _parallel (node_modules/async/internal/parallel.js:26:5)
at series (node_modules/async/series.js:83:26)
at handshake (node_modules/libp2p-secio/src/handshake/index.js:12:3)
at encrypt (node_modules/libp2p-secio/src/index.js:36:7)
at Object.swarm.handle [as handlerFunc] (src/connection.js:87:24)
at matcher (node_modules/multistream-select/src/listener/select-handler.js:40:28)
at some (node_modules/multistream-select/src/listener/select-handler.js:71:7)
3) libp2p-swarm secio conn upgrade (on TCP) dial to warm conn:
Uncaught TypeError: Cannot read property 'getRandomValues' of undefined
at Object.exports.randomBytes (node_modules/libp2p-secio/src/support.js:80:38)
at Object.exports.createProposal (node_modules/libp2p-secio/src/handshake/crypto.js:21:19)
at propose (node_modules/libp2p-secio/src/handshake/propose.js:18:31)
at series (node_modules/libp2p-secio/src/handshake/index.js:13:13)
at node_modules/async/internal/parallel.js:27:9
at replenish (node_modules/async/internal/eachOfLimit.js:64:17)
at node_modules/async/internal/eachOfLimit.js:68:9
at eachOfLimit (node_modules/async/eachOfLimit.js:37:36)
at node_modules/async/internal/doLimit.js:9:16
at _parallel (node_modules/async/internal/parallel.js:26:5)
at series (node_modules/async/series.js:83:26)
at handshake (node_modules/libp2p-secio/src/handshake/index.js:12:3)
at encrypt (node_modules/libp2p-secio/src/index.js:36:7)
at Object.swarm.handle [as handlerFunc] (src/connection.js:87:24)
at matcher (node_modules/multistream-select/src/listener/select-handler.js:40:28)
at some (node_modules/multistream-select/src/listener/select-handler.js:71:7)
4) libp2p-swarm secio conn upgrade (on TCP) dial on protocol, reuse warmed conn:
Uncaught TypeError: Cannot read property 'getRandomValues' of undefined
at Object.exports.randomBytes (node_modules/libp2p-secio/src/support.js:80:38)
at Object.exports.createProposal (node_modules/libp2p-secio/src/handshake/crypto.js:21:19)
at propose (node_modules/libp2p-secio/src/handshake/propose.js:18:31)
at series (node_modules/libp2p-secio/src/handshake/index.js:13:13)
at node_modules/async/internal/parallel.js:27:9
at replenish (node_modules/async/internal/eachOfLimit.js:64:17)
at node_modules/async/internal/eachOfLimit.js:68:9
at eachOfLimit (node_modules/async/eachOfLimit.js:37:36)
at node_modules/async/internal/doLimit.js:9:16
at _parallel (node_modules/async/internal/parallel.js:26:5)
at series (node_modules/async/series.js:83:26)
at handshake (node_modules/libp2p-secio/src/handshake/index.js:12:3)
at encrypt (node_modules/libp2p-secio/src/index.js:36:7)
at Object.swarm.handle [as handlerFunc] (src/connection.js:87:24)
at matcher (node_modules/multistream-select/src/listener/select-handler.js:40:28)
at some (node_modules/multistream-select/src/listener/select-handler.js:71:7)
5) libp2p-swarm secio conn upgrade (on TCP) enable identify to reuse incomming muxed conn:
Uncaught TypeError: Cannot read property 'getRandomValues' of undefined
at Object.exports.randomBytes (node_modules/libp2p-secio/src/support.js:80:38)
at Object.exports.createProposal (node_modules/libp2p-secio/src/handshake/crypto.js:21:19)
at propose (node_modules/libp2p-secio/src/handshake/propose.js:18:31)
at series (node_modules/libp2p-secio/src/handshake/index.js:13:13)
at node_modules/async/internal/parallel.js:27:9
at replenish (node_modules/async/internal/eachOfLimit.js:64:17)
at node_modules/async/internal/eachOfLimit.js:68:9
at eachOfLimit (node_modules/async/eachOfLimit.js:37:36)
at node_modules/async/internal/doLimit.js:9:16
at _parallel (node_modules/async/internal/parallel.js:26:5)
at series (node_modules/async/series.js:83:26)
at handshake (node_modules/libp2p-secio/src/handshake/index.js:12:3)
at encrypt (node_modules/libp2p-secio/src/index.js:36:7)
at Object.swarm.handle [as handlerFunc] (src/connection.js:87:24)
at matcher (node_modules/multistream-select/src/listener/select-handler.js:40:28)
at some (node_modules/multistream-select/src/listener/select-handler.js:71:7)
6) libp2p-swarm secio conn upgrade (on TCP) "after all" hook:
Uncaught AssertionError: expected true to not exist
at swarmB.dial (test/06-conn-upgrade-secio.node.js:103:25)
at attemptDial (src/dial.js:30:20)
at ms.select (src/dial.js:112:26)
at f (node_modules/once/once.js:25:25)
at select (node_modules/multistream-select/src/dialer/index.js:76:16)
at pullLP.decodeFromReader (node_modules/multistream-select/src/select.js:20:14)
at Object.cb (node_modules/pull-length-prefixed/lib/decode.js:75:16)
at drain (node_modules/pull-reader/index.js:42:23)
at node_modules/pull-reader/index.js:59:18
at node_modules/pull-reader/index.js:20:7
at node_modules/pull-reader/index.js:110:13
at drain (node_modules/stream-to-pull-stream/index.js:141:18)
at Socket.<anonymous> (node_modules/stream-to-pull-stream/index.js:158:5)
at endReadableNT (_stream_readable.js:974:12)
7) libp2p-swarm high level API - with everything mixed all together! warm up from A to B on tcp to tcp+ws:
AssertionError: expected [Error: No available transport to dial to] to not exist
at swarmA.dial (test/09-swarm-with-muxing.node.js:132:27)
at attemptDial (src/dial.js:30:20)
at attemptDial (src/dial.js:84:16)
at Swarm.dial (src/dial.js:28:9)
at parallel (test/09-swarm-with-muxing.node.js:131:22)
at node_modules/async/internal/parallel.js:27:9
at eachOfArrayLike (node_modules/async/eachOf.js:57:9)
at exports.default (node_modules/async/eachOf.js:9:5)
at _parallel (node_modules/async/internal/parallel.js:26:5)
at parallelLimit (node_modules/async/parallel.js:85:26)
at Context.it (test/09-swarm-with-muxing.node.js:122:5)
8) libp2p-swarm high level API - with everything mixed all together! warm up from A to B on tcp to tcp+ws:
AssertionError: expected [Error: No available transport to dial to] to not exist
at swarmA.dial (test/09-swarm-with-muxing.node.js:132:27)
at attemptDial (src/dial.js:30:20)
at attemptDial (src/dial.js:84:16)
at Swarm.dial (src/dial.js:28:9)
at parallel (test/09-swarm-with-muxing.node.js:131:22)
at node_modules/async/internal/parallel.js:27:9
at eachOfArrayLike (node_modules/async/eachOf.js:57:9)
at exports.default (node_modules/async/eachOf.js:9:5)
at _parallel (node_modules/async/internal/parallel.js:26:5)
at parallelLimit (node_modules/async/parallel.js:85:26)
at Context.it (test/09-swarm-with-muxing.node.js:122:5)
9) libp2p-swarm high level API - with everything mixed all together! warm up a warmed up, from B to A:
AssertionError: expected [Error: No available transport to dial to] to not exist
at swarmB.dial (test/09-swarm-with-muxing.node.js:141:25)
at attemptDial (src/dial.js:30:20)
at attemptDial (src/dial.js:84:16)
at Swarm.dial (src/dial.js:28:9)
at Context.it (test/09-swarm-with-muxing.node.js:140:12)
10) libp2p-swarm high level API - with everything mixed all together! warm up a warmed up, from B to A:
AssertionError: expected [Error: No available transport to dial to] to not exist
at swarmB.dial (test/09-swarm-with-muxing.node.js:141:25)
at attemptDial (src/dial.js:30:20)
at attemptDial (src/dial.js:84:16)
at Swarm.dial (src/dial.js:28:9)
at Context.it (test/09-swarm-with-muxing.node.js:140:12)
11) libp2p-swarm high level API - with everything mixed all together! dial from tcp to tcp+ws, on protocol:
AssertionError: expected [Error: No available transport to dial to] to not exist
at swarmA.dial (test/09-swarm-with-muxing.node.js:153:25)
at attemptDial (src/dial.js:30:20)
at attemptDial (src/dial.js:84:16)
at Swarm.dial (src/dial.js:28:9)
at Context.it (test/09-swarm-with-muxing.node.js:152:12)
12) libp2p-swarm high level API - with everything mixed all together! dial from ws to ws no proto:
AssertionError: expected [Error: No available transport to dial to] to not exist
at swarmD.dial (test/09-swarm-with-muxing.node.js:165:25)
at attemptDial (src/dial.js:30:20)
at attemptDial (src/dial.js:84:16)
at Swarm.dial (src/dial.js:28:9)
at Context.it (test/09-swarm-with-muxing.node.js:164:12)
13) libp2p-swarm high level API - with everything mixed all together! dial from ws to ws:
AssertionError: expected [Error: No available transport to dial to] to not exist
at swarmD.dial (test/09-swarm-with-muxing.node.js:177:25)
at attemptDial (src/dial.js:30:20)
at attemptDial (src/dial.js:84:16)
at Swarm.dial (src/dial.js:28:9)
at Context.it (test/09-swarm-with-muxing.node.js:176:12)
14) libp2p-swarm high level API - with everything mixed all together! dial from tcp to tcp+ws (returned conn):
AssertionError: expected [Error: No available transport to dial to] to not exist
at swarmA.dial (test/09-swarm-with-muxing.node.js:200:25)
at attemptDial (src/dial.js:30:20)
at attemptDial (src/dial.js:84:16)
at Swarm.dial (src/dial.js:28:9)
at Context.it (test/09-swarm-with-muxing.node.js:199:25)
15) libp2p-swarm high level API - with everything mixed all together! dial from tcp+ws to tcp+ws:
AssertionError: expected [Error: No available transport to dial to] to not exist
at swarmA.dial (test/09-swarm-with-muxing.node.js:232:25)
at attemptDial (src/dial.js:30:20)
at attemptDial (src/dial.js:84:16)
at Swarm.dial (src/dial.js:28:9)
at Context.it (test/09-swarm-with-muxing.node.js:231:12)
[16:54:39] 'mocha' errored after 54 s
[16:54:39] Error in plugin 'gulp-mocha'
Message:
15 tests failed.
npm ERR! Test failed. See above for more details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment