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

autorelay: fix flaky TestReconnectToStaticRelays #1903

Merged
merged 5 commits into from
Nov 22, 2022

Conversation

MarcoPolo
Copy link
Collaborator

Fixes this flaky test.

@marten-seemann marten-seemann changed the title Block on events to make this test less flaky autorelay: fix flaky tests Nov 19, 2022
marten-seemann
marten-seemann previously approved these changes Nov 20, 2022
@marten-seemann marten-seemann changed the title autorelay: fix flaky tests autorelay: fix flaky TestReconnectToStaticRelays Nov 20, 2022
@marten-seemann
Copy link
Contributor

The test is still failing:

  === RUN   TestReconnectToStaticRelays
      autorelay_test.go:517: 
          	Error Trace:	D:\a\go-libp2p\go-libp2p\p2p\host\autorelay\autorelay_test.go:517
          	Error:      	Not equal: 
          	            	expected: 0
          	            	actual  : 1
          	Test:       	TestReconnectToStaticRelays
  --- FAIL: TestReconnectToStaticRelays (2.89s)

@MarcoPolo MarcoPolo mentioned this pull request Nov 22, 2022
34 tasks
p2p/host/autorelay/autorelay_test.go Outdated Show resolved Hide resolved
p2p/host/autorelay/autorelay_test.go Outdated Show resolved Hide resolved
func expectDeltaInAddrUpdated(t *testing.T, addrUpdated event.Subscription, expectedDelta int) {
t.Helper()
delta := 0
for {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it ok that adding and removing would cancel out here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think so? I don't think it'll matter really

@MarcoPolo MarcoPolo merged commit 9fad5b0 into master Nov 22, 2022
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.

2 participants