Skip to content

Commit

Permalink
Fix race condition in back2back_test for UDP multicast bus (#1349)
Browse files Browse the repository at this point in the history
* Add debug prints to back2back_test to analyze race condition

Might fail if pytest does not print stdout

* Update IPv6 back2back test to use interface-local multicast address

Under unknown conditions the IPv6 multicast frames sent during the
test are reflected back to the sender twice. This causes the test to
fail. With this commit, the multicast frames sent during the test are
constrained to the local interface to potentially avoid a double
reception.

* Revert "Add debug prints to back2back_test to analyze race condition"

This reverts commit a830c09.
  • Loading branch information
lumagi authored Aug 10, 2022
1 parent c1736cc commit 88fc8e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/back2back_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,12 @@ def test_unique_message_instances(self):
"only supported on Unix systems (but not on Travis CI; and not on macOS at GitHub Actions)",
)
class BasicTestUdpMulticastBusIPv6(Back2BackTestCase):
HOST_LOCAL_MCAST_GROUP_IPv6 = "ff11:7079:7468:6f6e:6465:6d6f:6d63:6173"

INTERFACE_1 = "udp_multicast"
CHANNEL_1 = UdpMulticastBus.DEFAULT_GROUP_IPv6
CHANNEL_1 = HOST_LOCAL_MCAST_GROUP_IPv6
INTERFACE_2 = "udp_multicast"
CHANNEL_2 = UdpMulticastBus.DEFAULT_GROUP_IPv6
CHANNEL_2 = HOST_LOCAL_MCAST_GROUP_IPv6

def test_unique_message_instances(self):
with self.assertRaises(NotImplementedError):
Expand Down

0 comments on commit 88fc8e5

Please sign in to comment.