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

test: net: net and conngater tests #8084

Merged
merged 5 commits into from
Jul 13, 2022
Merged

test: net: net and conngater tests #8084

merged 5 commits into from
Jul 13, 2022

Conversation

TheMenko
Copy link
Contributor

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:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: 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, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

@TheMenko TheMenko requested a review from TheDivic February 12, 2022 17:49
@TheDivic
Copy link
Contributor

@TheMenko it would be good to add some tests for NetStat and NetLimit

Copy link
Contributor

@TheDivic TheDivic left a 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 Show resolved Hide resolved
itests/net_test.go Show resolved Hide resolved
itests/net_test.go Outdated Show resolved Hide resolved
@TheMenko TheMenko marked this pull request as ready for review February 18, 2022 13:10
@TheMenko TheMenko requested a review from a team as a code owner February 18, 2022 13:10
Comment on lines 63 to 65
if peerBandwidths[secondNodeID.String()] != bandwidth {
t.Errorf("bandwidths differ")
}
Copy link
Contributor

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

peers, err := firstNode.NetPeers(ctx)
require.NoError(t, err)

if len(peers) > 0 && peers[0].ID != addrInfo.ID {
Copy link
Contributor

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

Comment on lines 233 to 251
if len(list.IPAddrs) == 0 || list.IPAddrs[0] != secondNodeIPs[0] {
t.Errorf("blocked ip not in blocked ip list")
}
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Added this check

@arajasek arajasek force-pushed the itest_net_tests branch 2 times, most recently from ecefab5 to dde1ddc Compare July 7, 2022 22:47
@codecov
Copy link

codecov bot commented Jul 11, 2022

Codecov Report

Merging #8084 (9662c14) into master (a825682) will increase coverage by 0.20%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
itests/kit/ensemble.go 92.11% <100.00%> (ø)
chain/actors/builtin/miner/diff.go 48.52% <0.00%> (-10.30%) ⬇️
storage/wdpost/wdpost_sched.go 76.19% <0.00%> (-9.53%) ⬇️
storage/sealer/worker_tracked.go 80.83% <0.00%> (-6.67%) ⬇️
chain/events/observer.go 73.79% <0.00%> (-6.21%) ⬇️
chain/consensus/filcns/weight.go 70.58% <0.00%> (-5.89%) ⬇️
chain/exchange/peer_tracker.go 66.66% <0.00%> (-4.31%) ⬇️
miner/miner.go 56.39% <0.00%> (-2.63%) ⬇️
chain/types/tipset_key.go 74.68% <0.00%> (-2.54%) ⬇️
storage/sealer/sched_assigner_common.go 78.40% <0.00%> (-2.28%) ⬇️
... and 24 more

@arajasek arajasek merged commit ca713c5 into master Jul 13, 2022
@arajasek arajasek deleted the itest_net_tests branch July 13, 2022 19:59
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.

4 participants