-
Notifications
You must be signed in to change notification settings - Fork 974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests for HandledNodesTasks #584
Tests for HandledNodesTasks #584
Conversation
…e-listeners * upstream/master: Implement GET_PROVIDERS/ADD_PROVIDER Kademlia messages (libp2p#530) Make secio almost compile for asmjs/wasm (libp2p#519) Make it possible to accept/deny nodes in CollectionsStream (libp2p#512) Fix polling in handled_node.rs (libp2p#531) Remove notifying tasks (libp2p#528) Fix handler not properly shut down, and write test for this (libp2p#514) Use unsigned-varints, add BLAKE2 support in multihash (libp2p#525) Upgrade smallvec version to fix license issue (libp2p#526)
…e-listeners * upstream/master: Add unit tests for core::nodes::NodeStream (libp2p#535)
…e-listeners * upstream/master: Fix secio compied with --no-default-features (libp2p#545) multiaddr: explain the use of `&str` for `Unix`. (libp2p#543) Model HandshakeContext with explicit state transitions. (libp2p#532) multiaddr: add support for onion protocol. (libp2p#542)
…andled_node * dp/chore/test-core-listeners: Prefer freestanding function Address grumbles Remove non-project specific stuff Address grumbles
Add HandlerState and use it in TestBuilder Shorter test names
Test NotReady case
Track events as they reach the Handler Describe complex test logic
…nt contents More tests for poll()
…e-handled_node * upstream/master: Add `StreamMuxer::flush`. (libp2p#534) Tests for nodes/listeners.rs (libp2p#541) Deny relative addresses for UNIX domain sockets (libp2p#548) Optimise `Multiaddr::append`. (libp2p#549)
Please remove the printlns, the diff is really verbose. |
Done. |
Just in general I think it's bad to have style changes in the same PR as something else (or even in general two different changes in the same PR). It's tolerable when there are two or three style changes, but not more. I'm not going to ask you to revert the style changes, but this really pollute the diff. |
core/src/nodes/handled_node_tasks.rs
Outdated
|
||
// Even though we set up the muxer outbound state to be `Closed` we | ||
// still need to open a substream or the outbound state will never | ||
// be checked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fixed in the non-test code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll look into it, but I suspect that it's more of an artifact of the DummyMuxer
than a fault of the actual code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wrong and you're right (and the comment is correct); the NodeStream
does not check if the outbound state is open or closed (it does check the inbound state).
I'll open an issue and fix in separate PR, ok?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue #609
I agree with this, mixing things makes reviewing much harder than it needs to be. |
Test Task.send_event() and id() using a HandledNodesTasks
…e-handled_node_tasks * upstream/master: Inject event by value in ProtocolsHandler (libp2p#605) Add a PeriodicPingHandler and a PingListenHandler (libp2p#574) Fix stack overflow when printing a SubstreamRef (libp2p#599) Add a peer id generator (libp2p#583) eg. -> e.g.; ie. -> i.e. via repren (libp2p#592)
…e-handled_node_tasks * upstream/master: Use vecdeque for fair polling (libp2p#610) Add back the Swarm (libp2p#613) Remove dependency on tokio_current_thread (libp2p#606) Use chashmap from crates (libp2p#615) Fix grammar in core/nodes etc. (libp2p#608)
@tomaka I believe there are two outstanding issues here:
Other than the above, is there anything else I can do to move this forward? |
Yes, please remove the hierarchy of sub-modules in the tests. I disagree with the surprise factor for changing the Debug implementation. This struct is a collection of tasks, and every single collection in the Rust standard library uses this debug output. To me the reason why most |
I'll just make the change you prefer and if someone disagrees vehemently we can discuss it again. :) |
…e-handled_node_tasks * upstream/master: Tweaks, spelling and grammar (libp2p#629) Add a badge with a link to deps.rs (libp2p#630) Rewrite floodsub to use the ProtocolsHandler (libp2p#603) Add an IdentifyListen behaviour (libp2p#626) Add a custom derive for NetworkBehaviour (libp2p#619) Set the maximum size of Mplex messages to 1Mb (libp2p#622) Use expect rather than unwrap (libp2p#625) Make libp2p-websocket optional (libp2p#624) Add From<IpAddr> for Multiaddr (libp2p#623) Add implementations of NetworkBehaviour for ping (libp2p#618) Add a PeriodicIdentifyBehaviour (libp2p#617) Use upstream rust-secp256k1 (libp2p#616) Use yamux and aio-limited from crates.io (libp2p#621)
@tomaka ptal |
…lection_stream * upstream/master: Fix the concerns of libp2p#603 (libp2p#635) Tests for HandledNodesTasks (libp2p#584)
…ample * upstream/master: Fix the concerns of libp2p#603 (libp2p#635) Tests for HandledNodesTasks (libp2p#584) Tweaks, spelling and grammar (libp2p#629) Add a badge with a link to deps.rs (libp2p#630)
…_swarm * upstream/master: (33 commits) Behavior -> Behaviour (libp2p#650) Remove Send/Sync/'static reqs from ping (libp2p#652) Tests for CollectionStream (libp2p#588) Document the muxing module (libp2p#647) Document the core::upgrade module (libp2p#644) Send Close when shutting down gracefully, as per spec (libp2p#631) Remove the Send + 'static requirements for floodsub (libp2p#637) Move protocols_handler to the root (libp2p#643) Use a random sequence number in floodsub (libp2p#634) Split `ConnectionUpgrade`. (libp2p#642) Add an impl Debug for HandledNode (libp2p#628) minor typo in docs (libp2p#640) Update connected peers' topics on NodeEvent (libp2p#638) Fix the concerns of libp2p#603 (libp2p#635) Tests for HandledNodesTasks (libp2p#584) Tweaks, spelling and grammar (libp2p#629) Add a badge with a link to deps.rs (libp2p#630) Rewrite floodsub to use the ProtocolsHandler (libp2p#603) Add an IdentifyListen behaviour (libp2p#626) Add a custom derive for NetworkBehaviour (libp2p#619) ...
Based on #546