|
20 | 20 | import json
|
21 | 21 | import os
|
22 | 22 | import logging
|
23 |
| -#from time import sleep |
| 23 | +from time import sleep |
24 | 24 | from threading import Timer
|
25 | 25 | from subprocess import PIPE, STDOUT
|
26 | 26 |
|
@@ -1765,46 +1765,44 @@ def router(name, extra_config):
|
1765 | 1765 | cls.RouterA.wait_router_connected('RouterB')
|
1766 | 1766 | cls.RouterB.wait_router_connected('RouterA')
|
1767 | 1767 |
|
1768 |
| - # The following two tests are commented out temporarily until the proton disposition |
1769 |
| - # issue involving extension state is fixed on proton main |
1770 |
| - #def test_02_closest(self): |
1771 |
| - # """ |
1772 |
| - # Verify non-terminal state and data propagates over anycase |
1773 |
| - # """ |
1774 |
| - # test = ExtensionStateTester(self.RouterA.addresses[0], |
1775 |
| - # self.RouterB.addresses[0], |
1776 |
| - # "closest/fleabag") |
1777 |
| - # test.run() |
1778 |
| - # self.assertIsNone(test.error) |
1779 |
| - |
1780 |
| - #def test_03_multicast(self): |
1781 |
| - # """ |
1782 |
| - # Verify that disposition state set by the publisher is available to all |
1783 |
| - # consumers |
1784 |
| - # """ |
1785 |
| - # rxs = [MyExtendedReceiver(self.RouterA.addresses[0], |
1786 |
| - # "multicast/thingy") |
1787 |
| - # for x in range(3)] |
1788 |
| - # self.RouterA.wait_address("multicast/thingy", subscribers=3) |
1789 |
| - # sleep(0.5) # let subscribers grant credit |
1790 |
| - # tx = MyExtendedSender(self.RouterB.addresses[0], |
1791 |
| - # "multicast/thingy") |
1792 |
| - # tx.wait() |
1793 |
| - |
1794 |
| - # # DISPATCH-1705: only one of the receivers gets the data, but all |
1795 |
| - # # should get the state |
1796 |
| - |
1797 |
| - # ext_data = None |
1798 |
| - # for rx in rxs: |
1799 |
| - # rx.stop() |
1800 |
| - # try: |
1801 |
| - # while True: |
1802 |
| - # dispo = rx.remote_states.pop() |
1803 |
| - # self.assertEqual(999, dispo[0]) |
1804 |
| - # ext_data = dispo[1] or ext_data |
1805 |
| - # except IndexError: |
1806 |
| - # pass |
1807 |
| - # self.assertEqual([1, 2, 3], ext_data) |
| 1768 | + def test_02_closest(self): |
| 1769 | + """ |
| 1770 | + Verify non-terminal state and data propagates over anycase |
| 1771 | + """ |
| 1772 | + test = ExtensionStateTester(self.RouterA.addresses[0], |
| 1773 | + self.RouterB.addresses[0], |
| 1774 | + "closest/fleabag") |
| 1775 | + test.run() |
| 1776 | + self.assertIsNone(test.error) |
| 1777 | + |
| 1778 | + def test_03_multicast(self): |
| 1779 | + """ |
| 1780 | + Verify that disposition state set by the publisher is available to all |
| 1781 | + consumers |
| 1782 | + """ |
| 1783 | + rxs = [MyExtendedReceiver(self.RouterA.addresses[0], |
| 1784 | + "multicast/thingy") |
| 1785 | + for x in range(3)] |
| 1786 | + self.RouterA.wait_address("multicast/thingy", subscribers=3) |
| 1787 | + sleep(0.5) # let subscribers grant credit |
| 1788 | + tx = MyExtendedSender(self.RouterB.addresses[0], |
| 1789 | + "multicast/thingy") |
| 1790 | + tx.wait() |
| 1791 | + |
| 1792 | + # DISPATCH-1705: only one of the receivers gets the data, but all |
| 1793 | + # should get the state |
| 1794 | + |
| 1795 | + ext_data = None |
| 1796 | + for rx in rxs: |
| 1797 | + rx.stop() |
| 1798 | + try: |
| 1799 | + while True: |
| 1800 | + dispo = rx.remote_states.pop() |
| 1801 | + self.assertEqual(999, dispo[0]) |
| 1802 | + ext_data = dispo[1] or ext_data |
| 1803 | + except IndexError: |
| 1804 | + pass |
| 1805 | + self.assertEqual([1, 2, 3], ext_data) |
1808 | 1806 |
|
1809 | 1807 |
|
1810 | 1808 | class MyExtendedSender(AsyncTestSender):
|
|
0 commit comments