Skip to content
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

Event-based test refactoring for GossipSub RPC inspection unit tests #5374

Merged
merged 10 commits into from
Feb 28, 2024

Conversation

kc1116
Copy link
Contributor

@kc1116 kc1116 commented Feb 12, 2024

This PR makes a small but significant improvement to the control message validation inspector unit tests by removing the use of time.Sleep and instead wait until finished processing queued work item from the internal inspection request worker pool queue effectively making the tests more reliable.

spamMsgFactory: func(spammerId peer.ID, _ peer.ID, topic channels.Topic) *pubsub_pb.Message {
return p2ptest.PubsubMessageFixture(t, p2ptest.WithFrom(spammerId), p2ptest.WithTopic(topic.String()))
},
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.51%. Comparing base (cd875cb) to head (2bb8f51).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5374      +/-   ##
==========================================
+ Coverage   56.04%   59.51%   +3.47%     
==========================================
  Files        1026      430     -596     
  Lines      100116    44706   -55410     
==========================================
- Hits        56106    26605   -29501     
+ Misses      39707    16181   -23526     
+ Partials     4303     1920    -2383     
Flag Coverage Δ
unittests 59.51% <100.00%> (+3.47%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kc1116 kc1116 enabled auto-merge February 28, 2024 14:56
@kc1116 kc1116 added this pull request to the merge queue Feb 28, 2024
Merged via the queue into master with commit 0766584 Feb 28, 2024
51 checks passed
@kc1116 kc1116 deleted the khalil/refactor-gossipsub-inspector-tests branch February 28, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants