-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Sporadically failing test/simple/test-dgram-pingpong.js #2981
Comments
Does not reproduce on windows. |
I think I've seen it happen on all three supported Unices (Linux, Darwin, SunOS). It certainly fails regularly on Linux. It could be a bug in either the test itself or in the assumptions it makes - SOCK_DGRAM is not guaranteed to be reliable, even on loopback devices. |
If we're ok with SOCK_DGRAM dying randomly, and either just abruptly stop sending any messages, or fail part of the way through and send an empty message, then perhaps we can change the test around:
|
I take back what I said earlier: dropped packets is one thing but empty packets shouldn't happen. I'll investigate it. EDIT: I'm 90% sure that it's a bug in the slab allocator. |
Update: I found the cause (or causes, really):
I added some instrumentation to the Buffer class to check for premature collection. Lo and behold:
Note how the call to |
@bnoordhuis Wow, nice find! |
It looks like the sporadic failures in test/simple/test-dgram-pingpong.js are occurring because occasionally the server or client gets an empty buffer as the message, rather than the data that was sent.
isaacs/node@dgram-pingpong has a patch for the test to show this more clearly. It doesn't fail often, but when I run this:
it'll usually fail within about 200 iterations.
The text was updated successfully, but these errors were encountered: