-
Notifications
You must be signed in to change notification settings - Fork 518
test: fix logging after TestP2PHTTPHandler finishes #6469
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
base: master
Are you sure you want to change the base?
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| // zero clients allowed, rate limiting window (10s) is greater than queue deadline (1s) | ||
| netB, err := NewP2PNetwork(log, cfg, "", nil, GenesisInfo{genesisID, config.Devtestnet}, &nopeNodeInfo{}, nil, nil) | ||
| require.NoError(t, err) | ||
| defer netB.Stop() // even though netB.Start is not called, NewP2PNetwork creates goroutines to stop |
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.
which goroutines exactly? I only see that MakeCapabilitiesDiscovery can run gorotines indeed DHT is not needed for this test.
Upd: PR description mentions that. Read the test, EnableDHTProviders is needed for this test.
| // zero clients allowed, rate limiting window (10s) is greater than queue deadline (1s) | ||
| netB, err := NewP2PNetwork(log, cfg, "", nil, GenesisInfo{genesisID, config.Devtestnet}, &nopeNodeInfo{}, nil, nil) | ||
| require.NoError(t, err) | ||
| defer netB.Stop() // even though netB.Start is not called, NewP2PNetwork creates goroutines to stop |
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.
| defer netB.Stop() // even though netB.Start is not called, NewP2PNetwork creates goroutines to stop | |
| defer netB.Stop() // even though netB.Start is not called, NewP2PNetwork creates DHT goroutines to stop |
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.
Well probably DHT start initialization needs to be reworked to have Start running goroutines, not New
Summary
Occasionally
TestP2PHTTPHandlercauses the logger to be called after it finishes. The logging occurs inside a goroutine started by go-libp2p-kad-dht which is created whenNewP2PNetworkcallsp2p.MakeCapabilitiesDiscoverywhich callsMakeDHT. CallingP2PNetwork.Stop()callsdht.Close()and should shut down these goroutines.Test Plan
Test should stop having this rare flakiness.