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

quic: readfrom/writeto saver, updated tests #1176

Merged
merged 4 commits into from
Jan 12, 2021

Conversation

kelmenhorst
Copy link
Collaborator

No description provided.

Copy link
Contributor

@bassosimone bassosimone left a comment

Choose a reason for hiding this comment

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

I suspect one more change is needed? (Thank you for doing this so quickly and for adding the additional test checking what happens with a wrong IP!)

@@ -492,6 +492,7 @@ func NewNetworkEventsList(begin time.Time, events []trace.Event) []NetworkEvent
}
if ev.Name == errorx.ReadOperation {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think here you should handle also ReadFromOperation?

@@ -501,6 +502,7 @@ func NewNetworkEventsList(begin time.Time, events []trace.Event) []NetworkEvent
}
if ev.Name == errorx.WriteOperation {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think here you should also handle WriteToOperation?

@@ -74,6 +74,12 @@ const (
// WriteOperation is when we write to a socket
WriteOperation = "write"

// ReadFromOperation is when we read from an UDP socket
ReadFromOperation = "readfrom"
Copy link
Contributor

Choose a reason for hiding this comment

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

We use _ to separate other operations, so please use read_from

ReadFromOperation = "readfrom"

// WriteToOperation is when we write to an UDP socket
WriteToOperation = "writeto"
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be write_to

@@ -11,6 +11,44 @@ import (
"github.com/ooni/probe-engine/netx/trace"
)

func TestSystemDialerSuccess(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This test seems redundant? Isn't this a subset of TestSystemDialerSuccessWithReadWrite?

if err.Error() != "quicdialer: invalid IP representation" {
t.Fatal("expected another error here")
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change

Copy link
Contributor

@bassosimone bassosimone left a comment

Choose a reason for hiding this comment

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

This is great! 🥳🦜

@bassosimone bassosimone merged commit 15cfb63 into ooni:master Jan 12, 2021
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