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

add go-check workflow, fix gofmt, go vet and staticcheck #417

Closed
wants to merge 8 commits into from

Conversation

marten-seemann
Copy link
Contributor

Closes #415. Closes #416.

I see that running go test is more complicated on this repo, so we should probably not move it to GitHub Actions (yet).
@coryschwartz did an excellent job fixing all the go vet and staticcheck errors. We should merge these changes, and add the go-check workflow.

@marten-seemann
Copy link
Contributor Author

No idea why Circle is failing here. Seems to be unrelated to this PR. Some git clone failure?

}
}()
}
}

for err := range errs {
t.Fatal(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

or just make the calls above t.Errorf. a Fatal here is a bit weird, as the first one will exit the entire test.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, Errorf is better here.

topic_test.go Show resolved Hide resolved
@vyzo
Copy link
Collaborator

vyzo commented Apr 20, 2021

The CircleCI failure is odd, seems it can't checkout the code because of some key issue -- maybe credential rotation?

Copy link
Collaborator

@vyzo vyzo left a comment

Choose a reason for hiding this comment

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

some nits, other than that looks good.

I'll try to figure out the circle checkout issue, seems like they might have rotated some creds following the codecov debacle and we are htting that.

discovery_test.go Show resolved Hide resolved
@@ -405,16 +416,18 @@ func TestGossipsubAttackGRAFTDuringBackoff(t *testing.T) {

newMockGS(ctx, t, attacker, func(writeMsg func(*pb.RPC), irpc *pb.RPC) {
// When the legit host connects it will send us its subscriptions
errs := make(chan error)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we need to make this buffered or we might end up with stuck goroutines.

@@ -188,15 +188,17 @@ func TestGossipsubAttackSpamIHAVE(t *testing.T) {

newMockGS(ctx, t, attacker, func(writeMsg func(*pb.RPC), irpc *pb.RPC) {
// When the legit host connects it will send us its subscriptions
errs := make(chan error)
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be buffered i think.

}
}()
}
}

for err := range errs {
t.Fatal(err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, Errorf is better here.

}
}()
}
}

for err := range errs {
t.Fatal(err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, let's make that an Errof.

}
}()
}
}

for err := range errs {
t.Fatal(err)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Errorf I guess too.

topic_test.go Show resolved Hide resolved
@vyzo
Copy link
Collaborator

vyzo commented Apr 20, 2021

We might need to refresh the deploy key in the project settings? I don't have admin to do that however, @marten-seemann do you have perms?
Otherwise, @Stebalien might be able to help.

@jacobheun
Copy link

We might need to refresh the deploy key in the project settings? I don't have admin to do that however, @marten-seemann do you have perms?

I missed a few readds when I cycled keys due to the codecov incident last week. Remaining repos should have the new keys now

Control: &pb.ControlMessage{Graft: graft},
})

go func() {
defer close(errs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That will cause duplicate closes of the channel.

})

go func() {
defer close(errs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will cause duplicate closes of the channel.

})

go func() {
defer close(errs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will cause duplicate closes of the channel.

@vyzo
Copy link
Collaborator

vyzo commented Apr 23, 2021

the changes with the error channels seem to have broken some tests...

@mvdan
Copy link
Contributor

mvdan commented Apr 23, 2021

I think all the new channels should be unnecessary; just use Errorf where the original code used Fatalf :)

@aschmahmann aschmahmann added this to In Review in Maintenance Priorities - Go via automation Apr 26, 2021
@aschmahmann
Copy link
Contributor

@marten-seemann @vyzo what's the status of this PR?

@marten-seemann
Copy link
Contributor Author

@aschmahmann Due to the resource requirements (especially fds) of the test suite here, we removed this repo from the automation: protocol/.github#51. We can also close this PR.

Maintenance Priorities - Go automation moved this from In Review to Done May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants