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 improvements; add server.CloseConnection method #39

Merged
merged 6 commits into from
Mar 18, 2021

Conversation

daveyarwood
Copy link
Contributor

A small part of #37. On @glynternet 's suggestion, I'm turning that big PR into a series of smaller PRs that are easier to review and merge.

* Handle errors from client.Send.

* Use the higher-level server.ListenAndServe, which makes a connection
internally.

* Handle the non-problematic case where we get an expected error because we
forcibly closed the connection.
@daveyarwood daveyarwood changed the title Test improvements Test improvements; add server.CloseConnection function Mar 9, 2020
@daveyarwood daveyarwood changed the title Test improvements; add server.CloseConnection function Test improvements; add server.CloseConnection method Mar 9, 2020
@daveyarwood
Copy link
Contributor Author

See 52238bd for a summary of the test improvements.

Copy link
Contributor

@glynternet glynternet left a comment

Choose a reason for hiding this comment

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

Pretty much LGTM, just a couple of similfications.

osc/osc_test.go Show resolved Hide resolved
osc/osc_test.go Outdated Show resolved Hide resolved
osc/osc_test.go Show resolved Hide resolved
@@ -568,6 +572,18 @@ func (s *Server) Serve(c net.PacketConn) error {
}
}

// CloseConnection forcibly closes a server's connection.
//
// This causes a "use of closed network connection" error the next time the
Copy link
Contributor

Choose a reason for hiding this comment

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

I have a feeling I found a way around this before but I can't remember it now 🤔
I think it involved using the read timeout value, but I wouldn't worry about working it out for the sake of the tests.

@glynternet
Copy link
Contributor

glynternet commented Mar 10, 2020

Also, btw, disclaimer, I have absolutely no control when it comes to this repository.
I'm just trying to lift a little support/maintenance burden.

@daveyarwood
Copy link
Contributor Author

Thanks for your feedback and for helping to move things along more smoothly! I've changed a few things based on your feedback and fixed the CI failure, which appears to be from an interesting recent addition to go vet on the master branch version of Go.

Copy link
Contributor

@glynternet glynternet left a comment

Choose a reason for hiding this comment

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

LGTM. Hopefully @hypebeast will be available to take a look sometime soon 🙂

osc/osc_test.go Show resolved Hide resolved
@hypebeast hypebeast merged commit 3cbc1ae into hypebeast:master Mar 18, 2021
@daveyarwood daveyarwood deleted the test-improvements branch March 18, 2021 23:06
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.

None yet

3 participants