Skip to content

Commit

Permalink
Merge pull request #201 from NordSecurity/fix-flaky-test_dns_duplicat…
Browse files Browse the repository at this point in the history
…e_requests_on_multiple_forward_servers

Fix flaky test_dns_duplicate_requests_on_multiple_forward_servers
  • Loading branch information
tomaszklak authored Nov 10, 2023
2 parents cdcd82a + aca2c14 commit 387eff0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nat-lab/tests/test_dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,20 +741,21 @@ async def test_dns_duplicate_requests_on_multiple_forward_servers() -> None:

await client_alpha.enable_magic_dns([FIRST_DNS_SERVER, SECOND_DNS_SERVER])

await testing.wait_normal(
await testing.wait_long(
connection_alpha.create_process(
["nslookup", "google.com", config.LIBTELIO_DNS_IPV4]
).execute()
)

await asyncio.sleep(1)

tcpdump_stdout = process.get_stdout()
results = re.findall(
r".* IP .* > (?P<dest_ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,5}): .* A\?.*",
process.get_stdout(),
tcpdump_stdout,
) # fmt: skip

assert results
assert results, tcpdump_stdout
assert [result for result in results if FIRST_DNS_SERVER in result]
assert not ([result for result in results if SECOND_DNS_SERVER in result])

Expand Down

0 comments on commit 387eff0

Please sign in to comment.