Skip to content

Commit

Permalink
Fix tcp_check test_ipv6 flakiness (#11925)
Browse files Browse the repository at this point in the history
  • Loading branch information
L3n41c authored May 4, 2022
1 parent 7bcd3f0 commit 8f38248
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tcp_check/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
INSTANCE_MULTIPLE.update(INSTANCE)

INSTANCE_IPV6 = {
'host': 'app.datadoghq.com',
'host': 'app.datad0g.com',
'port': 80,
'timeout': 1.5,
'name': 'UpService',
Expand Down
6 changes: 3 additions & 3 deletions tcp_check/tests/test_tcp_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_ipv6(aggregator, check):

nb_ipv4, nb_ipv6 = 0, 0
for addr in check.addrs:
expected_tags = ["instance:UpService", "target_host:app.datadoghq.com", "port:80", "foo:bar"]
expected_tags = ["instance:UpService", "target_host:app.datad0g.com", "port:80", "foo:bar"]
expected_tags.append("address:{}".format(addr))
if re.match(r'^[0-9a-f:]+$', addr):
nb_ipv6 += 1
Expand All @@ -177,8 +177,8 @@ def test_ipv6(aggregator, check):
nb_ipv4 += 1
aggregator.assert_service_check('tcp.can_connect', status=check.OK, tags=expected_tags)
aggregator.assert_metric('network.tcp.can_connect', value=1, tags=expected_tags)
assert nb_ipv4 == 8
assert nb_ipv4 == 3
# The Windows CI machine doesn't return IPv6
assert nb_ipv6 == 8 or platform.system() == 'Windows' and nb_ipv6 == 0
assert nb_ipv6 == 3 or platform.system() == 'Windows' and nb_ipv6 == 0
aggregator.assert_all_metrics_covered()
assert len(aggregator.service_checks('tcp.can_connect')) == nb_ipv4 + nb_ipv6

0 comments on commit 8f38248

Please sign in to comment.