mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #2277] dns-test: spurious test failure tshark::tests::nameserver #949
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#949
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @japaric on GitHub (Jul 3, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2277
Describe the bug
what the title says
To Reproduce
cd conformance && cargo t -p dns-testExpected behavior
the test should always work
System:
Version:
Crate: dns-test
Version:
c340da8e09Additional context
This assertion failed.
Most likely,
tsharkprinted "new packets 1" and then immediately printed "new packets 2"; wait_for_capture exits on the first line match so it didn't see the second stdout line.@japaric commented on GitHub (Jul 3, 2024):
@justahero I think you looked into this before and I think you had the highest "success rate" in seeing the failure. I very rarely see it myself.
maybe we can change the assertion to
assert_ne!(0, capture)? I think that even whenwait_for_captureeagerly reports1instead of2,terminatealways returns 2 packets because it sends a signal totsharkand then waits untiltsharkcloses its stdout / stderr so that gives it chance to flush all the captured records. IOW,wait_for_capture's return value should be treated as a "hint" that indicates that there's at least N packets to be read.want to try that? @justahero
@justahero commented on GitHub (Jul 3, 2024):
Using the
assert_ne!(0, capture);assertion should work. On my Macbook I run into the test failure quite frequently, ~about 20-25% of the time. Indeedtsharkreports either.. new packets 2or split that into two separate lines with.. new packets 1. But it's also the only test that fails for me.I tried to find a valid solution for this issue earlier this week by detecting all lines & summing up the found packets, but it turned out to be a more complex issue. For one, there is no good way to detect all these
new packetslines correctly in theTshark::wait_for_capturemethod. The method returns at the first expected occurrence of: new packets. The output ofstdoutis consumed, checking for more lines here means the method blocks indefinitely.The other approach was to merge both
wait_for_capture&terminatemethods into a single one, to have a single location to get lines fromself.stdout, but this did not work either. It kind of worked for the failing test, but introduced other issues, that caused other tests to fail. In particular waiting fortsharkto log the captured messages became indeterministic. Even when increasing the sleep value to 5 in thekillcommand it did not fix the issue,tsharkwould log an incomplete set of captures to the capture file ineavesdrop, therefore causing some tests to fail.@japaric commented on GitHub (Jul 3, 2024):
another thing to try could be to replace the assertion for something like
the loop should exit in both the one "new packets 2" case and the two "new packets 1" case, no?
we have seen the failure in this repo CI for the first time so it would be good to fix it.
https://github.com/hickory-dns/hickory-dns/actions/runs/9777369448/job/26991905906#step:5:2050
@justahero commented on GitHub (Jul 3, 2024):
I think the
whileloop is a better solution as this still requires the number of captures to match an expected value. Maybe a new method added toTsharkthat expectsXnumber of packets is useful, e.g.tshark.wait_for_num_packets.