Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1fd2c7fc authored by Henri Chataing's avatar Henri Chataing Committed by Automerger Merge Worker
Browse files

Merge "RootCanal: Remove potential source of flakiness in LL tests" into main am: 782c1905

parents c60ffde2 782c1905
Loading
Loading
Loading
Loading
+29 −19
Original line number Diff line number Diff line
@@ -305,13 +305,23 @@ class ControllerTest(unittest.IsolatedAsyncioTestCase):

    async def expect_ll(self,
                        expected_pdus: typing.Union[list, typing.Union[ll.LinkLayerPacket, type]],
                        ignored_pdus: typing.Union[list, type] = [],
                        timeout: int = 3) -> ll.LinkLayerPacket:
        if not isinstance(ignored_pdus, list):
            ignored_pdus = [ignored_pdus]

        if not isinstance(expected_pdus, list):
            expected_pdus = [expected_pdus]

        packet = await asyncio.wait_for(self.controller.receive_ll(), timeout=timeout)
        async with asyncio.timeout(timeout):
            while True:
                packet = await asyncio.wait_for(self.controller.receive_ll())
                pdu = ll.LinkLayerPacket.parse_all(packet)

                for ignored_pdu in ignored_pdus:
                    if isinstance(pdu, ignored_pdu):
                        continue

                for expected_pdu in expected_pdus:
                    if isinstance(expected_pdu, type) and isinstance(pdu, expected_pdu):
                        return pdu
+2 −1
Original line number Diff line number Diff line
@@ -123,7 +123,8 @@ class Test(ControllerTest):
                                 advertising_address_type=ll.AddressType.PUBLIC,
                                 conn_interval=self.LL_initiator_connInterval,
                                 conn_peripheral_latency=self.LL_initiator_connPeripheralLatency,
                                 conn_supervision_timeout=self.LL_initiator_connSupervisionTimeout))
                                 conn_supervision_timeout=self.LL_initiator_connSupervisionTimeout),
            ignored_pdus=[ll.LeLegacyAdvertisingPdu])

        # 11. Upper Tester receives an HCI_LE_Connection_Complete event from the IUT including the
        # parameters sent to the IUT in step 8.