-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
test: net: net and conngater tests #8084
Conversation
@TheMenko it would be good to add some tests for |
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.
Make sure to check if this is not flaky by running it with go test -count=N
!
itests/net_test.go
Outdated
if peerBandwidths[secondNodeID.String()] != bandwidth { | ||
t.Errorf("bandwidths differ") | ||
} |
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.
Those can be different, and likely will be when non-zero values get reported
itests/net_test.go
Outdated
peers, err := firstNode.NetPeers(ctx) | ||
require.NoError(t, err) | ||
|
||
if len(peers) > 0 && peers[0].ID != addrInfo.ID { |
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'd check peer count with == 1
itests/net_test.go
Outdated
if len(list.IPAddrs) == 0 || list.IPAddrs[0] != secondNodeIPs[0] { | ||
t.Errorf("blocked ip not in blocked ip list") | ||
} |
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.
Can we try to NetConnect here, and see if it fails?
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.
Hey @magik6k , I asked about this part on slack but it got deleted, i'm not sure how this should work.
NetConnect won't fail there, nodes will still be able to connect, and that is true for peer,subnet and ip blocking.
Besides that, i tried to use full node and miner node, then block miner node and try to mine block and sync with full node, and even that works.
So blocking a node seems to not do anything. Do you have any tips on how this should be tested?
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.
Added this check
ecefab5
to
dde1ddc
Compare
dde1ddc
to
b1cfbeb
Compare
b1cfbeb
to
9662c14
Compare
Codecov Report
@@ Coverage Diff @@
## master #8084 +/- ##
==========================================
+ Coverage 40.65% 40.86% +0.20%
==========================================
Files 707 707
Lines 78716 78716
==========================================
+ Hits 32004 32169 +165
+ Misses 41242 41045 -197
- Partials 5470 5502 +32
|
Related Issues
Proposed Changes
This PR adds network integration tests specifically from node net and conngater files.
It has annotations that system test matrix uses (//stm comments)
Additional Info
Checklist
Before you mark the PR ready for review, please make sure that:
<PR type>: <area>: <change being made>
fix: mempool: Introduce a cache for valid signatures
PR type
: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, testarea
: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps