DISPATCH-1757: wait for both bidirectional link route addresses before testing

This closes #891
diff --git a/tests/system_tests_delivery_counts.py b/tests/system_tests_delivery_counts.py
index 81edbe6..6986308 100644
--- a/tests/system_tests_delivery_counts.py
+++ b/tests/system_tests_delivery_counts.py
@@ -636,7 +636,7 @@
         # to settle
         cls.routers[2].wait_router_connected('QDR.B')
         cls.routers[1].wait_router_connected('QDR.C')
-        cls.routers[2].wait_address("pulp.task", remotes=1, delay=3)
+        cls.routers[2].wait_address("pulp.task", remotes=1, delay=3, count=2)
 
         # This is not a classic router network in the sense that QDR.A and D are acting as brokers. We allow a little
         # bit more time for the routers to stabilize.
diff --git a/tests/system_tests_edge_router.py b/tests/system_tests_edge_router.py
index 2ee7111..fc619ca 100644
--- a/tests/system_tests_edge_router.py
+++ b/tests/system_tests_edge_router.py
@@ -1666,7 +1666,8 @@
                 self.link_dropped.set()
 
         ad = AttachDropper(self.EA1.route_container)
-        self.INT_B.wait_address("CfgLinkRoute1")
+        # wait for both in and out link route addresses to propagate
+        self.INT_B.wait_address("CfgLinkRoute1", count=2)
 
         # create a consumer, do not wait for link to open, reattach
         # on received detach
@@ -1676,14 +1677,13 @@
         ad.join() # wait for thread exit
 
         # wait until prefix addresses are removed
-        self._wait_address_gone(self.INT_B, "CCfgLinkRoute1")
-        self._wait_address_gone(self.INT_B, "DCfgLinkRoute1")
+        self._wait_address_gone(self.INT_B, "CfgLinkRoute1")
         rx.stop()
 
         # now attach a working service to the same address,
         # make sure it all works
         fs = FakeService(self.EA1.route_container)
-        self.INT_B.wait_address("CfgLinkRoute1")
+        self.INT_B.wait_address("CfgLinkRoute1", count=2)
         rx = AsyncTestReceiver(self.EB1.listener, 'CfgLinkRoute1/foo',
                                wait=False, recover_link=True)
         tx = AsyncTestSender(self.EA1.listener, 'CfgLinkRoute1/foo',
@@ -1712,7 +1712,7 @@
         # activate the pre-configured link routes
         ea1_mgmt = self.EA1.management
         fs = FakeService(self.EA1.route_container)
-        self.INT_B.wait_address("CfgLinkRoute1")
+        self.INT_B.wait_address("CfgLinkRoute1", count=2)
 
         for i in range(10):
             lr1 = ea1_mgmt.create(type=self.CFG_LINK_ROUTE_TYPE,
@@ -1727,7 +1727,7 @@
                                               'direction': 'in'})
             # verify that they are correctly propagated (once)
             if i == 9:
-                self.INT_B.wait_address("Test/*/9/#")
+                self.INT_B.wait_address("Test/*/9/#", count=2)
             lr1.delete()
             lr2.delete()
 
@@ -1783,7 +1783,7 @@
 
         # activate the link routes before the connection exists
         fs = FakeService(er.addresses[1])
-        er.wait_address("Edge1/*")
+        er.wait_address("Edge1/*", count=2)
 
         # create the connection to interior
         er_mgmt = er.management
@@ -1791,7 +1791,7 @@
                               name='toA',
                               attributes={'role': 'edge',
                                           'port': self.INTA_edge_port})
-        self.INT_B.wait_address("Edge1/*")
+        self.INT_B.wait_address("Edge1/*", count=2)
 
         # delete it, and verify the routes are removed
         ctor.delete()
@@ -1802,7 +1802,7 @@
                               name='toA',
                               attributes={'role': 'edge',
                                           'port': self.INTA_edge_port})
-        self.INT_B.wait_address("Edge1/*")
+        self.INT_B.wait_address("Edge1/*", count=2)
         self._test_traffic(self.INT_B.listener,
                            self.INT_B.listener,
                            "Edge1/One",
@@ -1823,7 +1823,7 @@
             self.skipTest ( "Test skipped during development." )
 
         fs = FakeService(self.EA1.route_container)
-        self.INT_B.wait_address("CfgLinkRoute1")
+        self.INT_B.wait_address("CfgLinkRoute1", count=2)
 
         # create a sender on one edge and the receiver on another
         bc_b = BlockingConnection(self.EB1.listener, timeout=TIMEOUT)
@@ -1891,7 +1891,7 @@
         a_type = 'org.apache.qpid.dispatch.router.address'
 
         fs = FakeService(self.EA1.route_container)
-        self.INT_B.wait_address("CfgLinkRoute1")
+        self.INT_B.wait_address("CfgLinkRoute1", count=2)
 
         self._test_traffic(self.INT_B.listener,
                            self.INT_B.listener,
@@ -1909,7 +1909,7 @@
         # repeat test, but this time with patterns:
 
         fs = FakeService(self.EB1.route_container)
-        self.INT_A.wait_address("*.cfg.pattern.#")
+        self.INT_A.wait_address("*.cfg.pattern.#", count=2)
 
         self._test_traffic(self.INT_A.listener,
                            self.INT_A.listener,
@@ -1921,7 +1921,6 @@
         self.assertEqual(5, fs.out_count)
         self._wait_address_gone(self.INT_A, "*.cfg.pattern.#")
 
-
     def test_52_conn_link_route_proxy(self):
         """
         Test connection scoped link routes by connecting a fake service to the
@@ -1942,7 +1941,7 @@
                                               "direction": "in"})])
         self.assertEqual(2, len(fs.values))
 
-        self.INT_B.wait_address("Conn/*/One")
+        self.INT_B.wait_address("Conn/*/One", count=2)
         self.assertEqual(2, len(self._get_address(self.INT_A, "Conn/*/One")))
 
         # between interiors
@@ -2996,8 +2995,8 @@
         # start a new broker on EB1
         fake_broker = FakeBroker(self.EB1.route_container)
         # wait until the link route appears on the interior routers
-        self.INT_B.wait_address("MyLinkRoute")
-        self.INT_A.wait_address("MyLinkRoute")
+        self.INT_B.wait_address("MyLinkRoute", count=2)
+        self.INT_A.wait_address("MyLinkRoute", count=2)
         return fake_broker
 
     def spawn_receiver(self, router, count, address, expect=None):
@@ -3045,7 +3044,6 @@
         """
         Verify that a streaming message can be delivered over a link route
         """
-
         fake_broker = self._start_broker_EB1()
 
         rx = self.spawn_receiver(self.EB1, count=1,
diff --git a/tests/system_tests_link_routes.py b/tests/system_tests_link_routes.py
index e8d5d1d..e6f351c 100644
--- a/tests/system_tests_link_routes.py
+++ b/tests/system_tests_link_routes.py
@@ -167,7 +167,7 @@
         # to settle
         cls.routers[1].wait_router_connected('QDR.C')
         cls.routers[2].wait_router_connected('QDR.B')
-        cls.routers[2].wait_address("org.apache", remotes=1, delay=0.5)
+        cls.routers[2].wait_address("org.apache", remotes=1, delay=0.5, count=2)
 
         # This is not a classic router network in the sense that QDR.A and D are acting as brokers. We allow a little
         # bit more time for the routers to stabilize.
@@ -442,7 +442,7 @@
 
         # wait until the host we're connecting to gets its next hop for the
         # pattern we're connecting to
-        connect_node.wait_address(expected_pattern, remotes=1, delay=0.1)
+        connect_node.wait_address(expected_pattern, remotes=1, delay=0.1, count=2)
 
         # Connect to 'connect_node' and send message to 'address'
 
@@ -1919,10 +1919,8 @@
         self.assertEqual(2, len(fs.values))
 
         # the address should propagate to A and B
-        self.QDR_A.wait_address(address="Eflea.*")
-        self.QDR_A.wait_address(address="Fflea.*")
-        self.QDR_B.wait_address(address="Eflea.*")
-        self.QDR_B.wait_address(address="Fflea.*")
+        self.QDR_A.wait_address(address="flea.*", count=2)
+        self.QDR_B.wait_address(address="flea.*", count=2)
 
         # now have the service delete the config
         fs.delete_config()
@@ -1955,8 +1953,7 @@
         self.assertEqual(2, len(fs.values))
 
         # wait for the address to propagate to B
-        self.QDR_B.wait_address(address="Eflea.*")
-        self.QDR_B.wait_address(address="Fflea.*")
+        self.QDR_B.wait_address(address="flea.*", count=2)
 
         # ensure the link routes are not visible via other connections
         clrs = mgmt_A.query(self._AS_TYPE)
@@ -2446,7 +2443,7 @@
         cls.fake_service = FakeService(cls.QDR_A.addresses[1],
                                        container_id="FakeService")
         cls.QDR_C.wait_address("closest/test-client",
-                               remotes=1)
+                               remotes=1, count=2)
 
     def test_01_parallel_link_routes(self):
         """
diff --git a/tests/system_tests_link_routes_add_external_prefix.py b/tests/system_tests_link_routes_add_external_prefix.py
index 77ccf7e..8813eef 100644
--- a/tests/system_tests_link_routes_add_external_prefix.py
+++ b/tests/system_tests_link_routes_add_external_prefix.py
@@ -109,7 +109,7 @@
         # to settle
         cls.routers[1].wait_router_connected('QDR.C')
         cls.routers[2].wait_router_connected('QDR.B')
-        cls.routers[2].wait_address("foo", remotes=1, delay=0.5)
+        cls.routers[2].wait_address("foo", remotes=1, delay=0.5, count=2)
 
         # This is not a classic router network in the sense that QDR.A is acting as a broker. We allow a little
         # bit more time for the routers to stabilize.
diff --git a/tests/system_tests_one_router.py b/tests/system_tests_one_router.py
index 0a188ea..0fdc52f 100644
--- a/tests/system_tests_one_router.py
+++ b/tests/system_tests_one_router.py
@@ -3905,7 +3905,7 @@
                                        auto_accept=False,
                                        auto_settle=False)
         cls.router.wait_connectors()
-        cls.router.wait_address("closest/queue01")
+        cls.router.wait_address("closest/queue01", count=2)
 
     def test_01_verify_attach(self):
         """
diff --git a/tests/system_tests_policy_oversize_compound.py b/tests/system_tests_policy_oversize_compound.py
index 7a54006..8c5aeb8 100644
--- a/tests/system_tests_policy_oversize_compound.py
+++ b/tests/system_tests_policy_oversize_compound.py
@@ -1192,7 +1192,7 @@
         cls.fake_broker = Dummy("amqp://127.0.0.1:" + str(cls.fb_port),
                                        container_id="FakeBroker")
         cls.INT_B.wait_address("oversize",
-                               containers=1)
+                               containers=1, count=2)
 
     @classmethod
     def tearDownClass(cls):
diff --git a/tests/system_tests_two_routers.py b/tests/system_tests_two_routers.py
index 6c382f1..c2aec27 100644
--- a/tests/system_tests_two_routers.py
+++ b/tests/system_tests_two_routers.py
@@ -2031,7 +2031,7 @@
 
         fs = MyExtendedService(self.RouterB.addresses[1],
                                container_id="FakeService")
-        self.RouterA.wait_address("RoutieMcRouteFace", remotes=1)
+        self.RouterA.wait_address("RoutieMcRouteFace", remotes=1, count=2)
 
         tx = MyExtendedSender(self.RouterA.addresses[0],
                               "RoutieMcRouteFace")