aprsc
aprsc copied to clipboard
Test failures in UDP load test
Environment: Ubuntu 18.04.4; Linux bach 4.15.0-109-generic #110-Ubuntu SMP Tue Jun 23 02:39:32 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
aprsc master branch
On make test, the following is observed:
t/64udp-load.t ................... 1/14 bound udp port 127.0.0.1 16405, rcvbuf 65536 sndbuf 65536
Load testing full feed => UDP peer:
reading the rest, have received 6119 packets, sent 6421
t/64udp-load.t ................... 7/14 rcved undefined
after reading the rest, have received 6303 packets, sent 6421, outstanding 9424 bytes
took 3.544 seconds, 1778 packets/sec
missing: F100>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 90 blaa blaa blaa blaa END
F101>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 91 blaa blaa blaa blaa END
F102>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 92 blaa blaa blaa blaa END
F103>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 93 blaa blaa blaa blaa END
F104>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 94 blaa blaa blaa blaa END
F105>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 95 blaa blaa blaa blaa END
F106>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 96 blaa blaa blaa blaa END
[...]
F299>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 289 blaa blaa blaa blaa END
F300>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 290 blaa blaa blaa blaa END
F97>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 87 blaa blaa blaa blaa END
F98>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 88 blaa blaa blaa blaa END
F99>APRS,qAR,OH9XYZ-5:!6028.51N/02505.68E# packet 89 blaa blaa blaa blaa END
# Test 7 got: "6303" (t/64udp-load.t at line 142)
# Expected: "6421" (Received wrong number of lines from blob)
# t/64udp-load.t line 142 is: ok($rxn, $txn, "Received wrong number of lines from blob");
# Test 8 got: "514908" (t/64udp-load.t at line 143)
# Expected: "524332" (Received wrong number of bytes from blob)
# t/64udp-load.t line 143 is: ok($rxl, $txl, "Received wrong number of bytes from blob");
# Test 9 got: "9424" (t/64udp-load.t at line 144)
# Expected: "0" (There are outstanding bytes in the server after timeout)
# t/64udp-load.t line 144 is: ok($outstanding, 0, "There are outstanding bytes in the server after timeout");
Load testing UDP peer => full feed:
reading the rest, have received 6118 packets, sent 6421
[ ... more test output ... ]
Test Summary Report
-------------------
t/64udp-load.t (Wstat: 0 Tests: 14 Failed: 6)
Failed tests: 7-12
Files=36, Tests=2521, 142 wallclock secs ( 0.57 usr 0.17 sys + 3.66 cusr 3.98 csys = 8.38 CPU)
Result: FAIL
Failed 1/36 test programs. 6/2521 subtests failed.
Makefile:19: recipe for target 'test' failed
make[1]: *** [test] Error 255
make[1]: Leaving directory '/home/gewesp/git/github/aprsc/tests'
Makefile:138: recipe for target 'test' failed
make: *** [test] Error 2
The UDP load test is a bit flaky, it floods the server with packets and on some systems so fast that the UDP socket buffers overflow a bit. The test is designed badly: On UDP, if you send packets fast enough, there is no flow control, buffers will overflow and some packets will be lost.
Should rework the test a bit to make it wait for some output on the other side before flooding more.
In other words, I think the server itself is fine.
Just FYI and FWIW: I saw something similar when testing the latest version of APRSC (2.1.8) for a vintage i686 machine. Also did the same thing on an Raspberry Pi 4 and didn't have these UDP errors.
Yep, on some systems it's sporadic, sometimes happens and sometimes doesn't. The test should have a bit of flow control to avoid overflowing the UDP socket buffers.