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

x/net/internal/socket: failures in TestUDP/Messages* #49385

Closed
bcmills opened this issue Nov 5, 2021 · 2 comments
Closed

x/net/internal/socket: failures in TestUDP/Messages* #49385

bcmills opened this issue Nov 5, 2021 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Nov 5, 2021

--- FAIL: TestUDP (0.01s)
    --- FAIL: TestUDP/Messages (0.00s)
        socket_test.go:252: got 1; want 2
    --- FAIL: TestUDP/Messages-dialed (0.01s)
        socket_test.go:308: got []byte{0x52, 0x2d, 0x55, 0x2d, 0x54, 0x48, 0x48, 0x45, 0x4c, 0x4c, 0x4f, 0x2d}; want []byte{0x48, 0x45, 0x4c, 0x4c, 0x4f, 0x2d, 0x52, 0x2d, 0x55, 0x2d, 0x54, 0x48, 0x45, 0x52, 0x45}
FAIL
FAIL	golang.org/x/net/internal/socket	0.144s

(These aren't particularly useful test failures, either — they give no indication as to the inputs or setup for the test, or even the operation that produced the unexpected result!)

greplogs --dashboard -md -l -e 'FAIL: TestUDP/Messages'

2021-11-05T05:30:39-ce13745-b68c02e/linux-mips-rtrk
2021-11-04T16:36:19-7594919-f934b83/linux-mips64-rtrk
2021-11-03T05:00:00-4a448f8-519c0a2/linux-mips-rtrk
2021-10-23T06:36:16-d418f37-85d2751/linux-mips-rtrk
2021-10-15T01:35:56-fd004c5-0c45ed0/linux-mips64-rtrk
2021-09-25T17:06:17-3ad01bb-ba76730/linux-mips-rtrk
2021-07-22T19:26:40-853a461-798ec73/linux-mips64-rtrk
2021-05-20T16:09:29-4163338-ef1f52c/linux-mips64-rtrk
2021-05-19T01:09:20-4163338-15a374d/linux-mips64le-rtrk
2021-03-15T17:06:53-34ac3e1-dcffdac/linux-386-stretch
2020-12-15T20:58:17-ac852fb-3d64678/linux-mips64-rtrk

@gopherbot gopherbot added this to the Unreleased milestone Nov 5, 2021
@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Nov 5, 2021
@bcmills
Copy link
Contributor Author

bcmills commented Nov 5, 2021

Looks like the messages-dialed test is new as of CL 316712.

@matzf, could you take a look at these failures? (CC @ianlancetaylor)

matzf added a commit to matzf/net that referenced this issue Dec 1, 2021
TestUDP/Messages and TestUDP/Messages-dialed occasionally failed because
the expected messages were not received in a single RecvMsgs call, or
because the messages were received out of order.

Assuming that both messages are returned immediately from a single
RecvMsgs call was a flawed expectation. Fixed by repeatedly invoking
RecvMsgs until all expected messages have been received.

While it certainly seems unusual that packets are reordered on a
loopback device, it does appear to happen occasionally (on linux-mips).
Fixed by sizing receive buffers such that messages in any order can be
received correctly, and by allowing either order for the reassembled
message.

Combine "Messages" and "Messages-dialed" subtests with a simple
table-driven test, to avoid the repetition. The same "Message" and
"Message-dialed".
Finally, make the test failure messages slightly more useful.

Fixes golang/go#49385
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/368094 mentions this issue: internal/socket: handle reordering in TestUDP/Messages

@golang golang locked and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants