Skip to content

Changes to get tests passing on .NET standard #65

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

Open
wants to merge 13 commits into
base: net-standard
Choose a base branch
from

Conversation

terite
Copy link

@terite terite commented Feb 7, 2021

The goal for this PR is to get tests passing, then pull out relevant commits into their own PRs.

@terite terite force-pushed the david/net-standard branch from 8a5844f to a61d8f7 Compare February 7, 2021 00:36
In my experience, DisconnectAndReconnect and DisconnectAndReconnectAsync
fail inconsistently. When they fail, they often take 10 seconds to do
so. With this change, flaky tests fail faster and more often.
StartReceive does not need to call ReceiveFromAsync more than once
because Receive will call StartReceive when it's done.
ermau told me that this is an obsolete test that can be removed.
ConnectionFailed is not a test where repeated runs add more information.
@terite terite force-pushed the david/net-standard branch from 77caab2 to e6f3432 Compare February 7, 2021 23:38
These two test cases don't pass consistently for UDP tests. They mostly
fail due to timeouts. This seems like lock contention issues, or maybe
an inefficient UDP ack.
This test now takes less time to fail, and fails more often for invalid
code. In addition, this test now asserts that the OnConnect and
OnDisconnect events fire the correct number of times.
Calling Disconnect sends a DisconnectMessage.
Receiving a DisconnectMessage calls Disconnect.
The response to a DisconnectMessage is a DisconnectMessage.

To avoid odd situations like OnDisconnected being fired twice, only
allow one call to Disconnect at a time.
In stressful situations, Socket.ReceiveFromAsync can be "sync" many
times in a row, enough to cause a stack overflow. Switching to a while
loop and Customized "Completed" handling avoids these stack overflows.

Some socket errors are transient, and should not trigger disposal of
shared resources. Previously, any errors (or even empty payloads) were
treated as fatal errors which ended the receive loop. This resulted in
connections silently ignoring incoming messages.
@terite terite marked this pull request as ready for review February 11, 2021 19:54
@terite
Copy link
Author

terite commented Feb 11, 2021

@ermau I'm going to start splitting this up into smaller parts soon. Let me know if you have any big-picture feedback first though :)

@terite terite changed the title [WIP] Changes to get tests passing on .NET standard Changes to get tests passing on .NET standard Feb 14, 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.

1 participant