Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Test suite fails on ubuntu1804 #120

Closed
MylesBorins opened this issue Dec 26, 2018 · 3 comments · Fixed by #123
Closed

Test suite fails on ubuntu1804 #120

MylesBorins opened this issue Dec 26, 2018 · 3 comments · Fixed by #123

Comments

@MylesBorins
Copy link

All release lines

@richardlau
Copy link
Member

Sample failure:

https://ci.nodejs.org/job/citgm-smoker-nobuild/499/nodes=ubuntu1804-64/testReport/

     not ok 13 - Checking udp uv handle
       ---
       found: >-
         (Flags: R=Ref, A=Active)
         Flags  Type      Address             Details
         [-A]   async     0x0000000002fd3a00  
         [-A]   timer     0x00007ffd0af8fb30  repeat: 0, timeout in: 342 ms
         [-A]   check     0x00007ffd0af8fbc8  
         [R-]   idle      0x00007ffd0af8fc40  
         [--]   prepare   0x00007ffd0af8fcb8  
         [--]   check     0x00007ffd0af8fd30  
         [-A]   async     0x0000000002624840  
         [RA]   pipe      0x0000000003059108  send buffer size: 212992, recv buffer
         size: 212992, file descriptor: 3, write queue size: 0, readable, writable
         [-A]   async     0x00007fb7188a2ce0  
         [RA]   fs_event  0x000000000303b5b0  filename:
         /home/iojs/build/workspace/citgm-smoker-nobuild/citgm_tmp/1b3a4362-d761-46eb-8cd1-be9f6a1f9fc1/node-report/test/test-api-uvhandles.js
         [RA]   fs_poll   0x0000000003033d30  filename:
         /home/iojs/build/workspace/citgm-smoker-nobuild/citgm_tmp/1b3a4362-d761-46eb-8cd1-be9f6a1f9fc1/node-report/test/test-api-uvhandles.js
         [R-]   pipe      0x00000000030ab788  send buffer size: 212992, recv buffer
         size: 212992, file descriptor: 20, write queue size: 0, readable, writable
         [RA]   pipe      0x0000000003056ca8  send buffer size: 212992, recv buffer
         size: 212992, file descriptor: 22, write queue size: 0, readable, writable
         [RA]   pipe      0x0000000003056e58  send buffer size: 212992, recv buffer
         size: 212992, file descriptor: 24, write queue size: 0, readable, writable
         [RA]   process   0x0000000003056b80  pid: 3829
         [RA]   udp       0x000000000302f190  , send buffer size: 212992, recv buffer
         size: 212992, file descriptor: 23
         [RA]   tcp       0x000000000302ef88  :::43621 (not connected), send buffer
         size: 16384, recv buffer size: 87380, file descriptor: 21, write queue size: 0
         [RA]   tcp       0x00000000030d0328  localhost:36766 connected to
         localhost:43621, send buffer size: 2626560, recv buffer size: 1061808, file
         descriptor: 25, write queue size: 0, readable, writable
         [RA]   tcp       0x00000000030c6b28  localhost:43621 connected to
         localhost:36766, send buffer size: 2626560, recv buffer size: 1062000, file
         descriptor: 26, write queue size: 0, readable, writable
       pattern: '/\[RA]\s+udp\s+\b(?:0+x)?[0-9a-fA-F]+\b\s+\S+:57133\b/'
       at:
         line: 142
         column: 9
         file: test/test-api-uvhandles.js
         type: ChildProcess
         function: child.on
       stack: |
         ChildProcess.child.on (test/test-api-uvhandles.js:142:9)
       source: |
         tap.match(summary, udp_re, 'Checking udp uv handle');
       ...

It looks like reportEndpoints() failed to report the address:port (note nothing before the , in the udp case (tcp looks as expected)

[RA]   udp       0x000000000302f190  , send buffer size: 212992, recv buffer
         size: 212992, file descriptor: 23

).

void reportEndpoints(uv_handle_t* h, std::ostringstream& out) {
struct sockaddr_storage addr_storage;
struct sockaddr* addr = (sockaddr*)&addr_storage;
char hostbuf[NI_MAXHOST];
char portbuf[NI_MAXSERV];
uv_any_handle* handle = (uv_any_handle*)h;
int addr_size = sizeof(addr_storage);
int rc = -1;
switch (h->type) {
case UV_UDP: {
rc = uv_udp_getsockname(&(handle->udp), addr, &addr_size);
break;
}
case UV_TCP: {
rc = uv_tcp_getsockname(&(handle->tcp), addr, &addr_size);
break;
}
default: break;
}
if (rc == 0) {
// getnameinfo will format host and port and handle IPv4/IPv6.
rc = getnameinfo(addr, addr_size, hostbuf, sizeof(hostbuf), portbuf,
sizeof(portbuf), NI_NUMERICSERV);
if (rc == 0) {
out << std::string(hostbuf) << ":" << std::string(portbuf);
}
if (h->type == UV_TCP) {
// Get the remote end of the connection.
rc = uv_tcp_getpeername(&(handle->tcp), addr, &addr_size);
if (rc == 0) {
rc = getnameinfo(addr, addr_size, hostbuf, sizeof(hostbuf), portbuf,
sizeof(portbuf), NI_NUMERICSERV);
if (rc == 0) {
out << " connected to ";
out << std::string(hostbuf) << ":" << std::string(portbuf);
}
} else if (rc == UV_ENOTCONN) {
out << " (not connected)";
}
}
}
}

@richardlau
Copy link
Member

The corresponding test in core doesn't check the port number which is why we're not seeing failures in core.

@richardlau
Copy link
Member

Proposed fix: #123 (port of nodejs/node#26140 from core).

richardlau added a commit to richardlau/nodereport that referenced this issue Mar 5, 2019
Ports fixes from core:
nodejs/node#25962
nodejs/node#26140

PR-URL: nodejs#123
Fixes: nodejs#120
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
richardlau added a commit that referenced this issue Mar 5, 2019
Ports fixes from core:
nodejs/node#25962
nodejs/node#26140

PR-URL: #123
Fixes: #120
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants