From fc0cf1979f3d65a9a29c6e5f5ec09d9fe828a477 Mon Sep 17 00:00:00 2001 From: Lucas Abel <22837557+uael@users.noreply.github.com> Date: Tue, 19 Dec 2023 13:40:21 +0000 Subject: [PATCH] cases: reset devices one by one Reseting devices in parallel can lead to flakiness (eg. the DUT has re-connect logics and REF reset too fast). --- avatar/cases/host_test.py | 5 ++++- avatar/cases/le_host_test.py | 5 ++++- avatar/cases/le_security_test.py | 5 ++++- avatar/cases/security_test.py | 5 ++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/avatar/cases/host_test.py b/avatar/cases/host_test.py index feaeaa5..d53705f 100644 --- a/avatar/cases/host_test.py +++ b/avatar/cases/host_test.py @@ -59,7 +59,10 @@ def teardown_class(self) -> None: @avatar.asynchronous async def setup_test(self) -> None: # pytype: disable=wrong-arg-types - await asyncio.gather(self.dut.reset(), self.ref.reset()) + # NOTE: this used to be performed in parallel but can lead to flakiness + # (eg. the DUT has re-connect logics and REF reset too fast). + await self.dut.reset() + await self.ref.reset() @avatar.parameterized( (DISCOVERABLE_LIMITED,), diff --git a/avatar/cases/le_host_test.py b/avatar/cases/le_host_test.py index 8af96fa..f13bed5 100644 --- a/avatar/cases/le_host_test.py +++ b/avatar/cases/le_host_test.py @@ -74,7 +74,10 @@ def teardown_class(self) -> None: @avatar.asynchronous async def setup_test(self) -> None: # pytype: disable=wrong-arg-types - await asyncio.gather(self.dut.reset(), self.ref.reset()) + # NOTE: this used to be performed in parallel but can lead to flakiness + # (eg. the DUT has re-connect logics and REF reset too fast). + await self.dut.reset() + await self.ref.reset() @avatar.parameterized( *itertools.product( diff --git a/avatar/cases/le_security_test.py b/avatar/cases/le_security_test.py index d8495e9..3f4bee3 100644 --- a/avatar/cases/le_security_test.py +++ b/avatar/cases/le_security_test.py @@ -152,7 +152,10 @@ async def test_le_pairing( raise signals.TestSkip('CTKD requires Security Level 4') # Factory reset both DUT and REF devices. - await asyncio.gather(self.dut.reset(), self.ref.reset()) + # NOTE: this used to be performed in parallel but can lead to flakiness + # (eg. the DUT has re-connect logics and REF reset too fast). + await self.dut.reset() + await self.ref.reset() # Override REF IO capability if supported. if isinstance(self.ref, BumblePandoraDevice): diff --git a/avatar/cases/security_test.py b/avatar/cases/security_test.py index 5749ed8..8615808 100644 --- a/avatar/cases/security_test.py +++ b/avatar/cases/security_test.py @@ -200,7 +200,10 @@ async def test_ssp( raise signals.TestSkip('CTKD cases must be conducted under Security Level 4') # Factory reset both DUT and REF devices. - await asyncio.gather(self.dut.reset(), self.ref.reset()) + # NOTE: this used to be performed in parallel but can lead to flakiness + # (eg. the DUT has re-connect logics and REF reset too fast). + await self.dut.reset() + await self.ref.reset() # Override REF IO capability if supported. if isinstance(self.ref, BumblePandoraDevice):