Skip to content

Commit a59988f

Browse files
committed
fix: use asyncio.wait_for for backward compatibility
1 parent a9ff7d2 commit a59988f

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

tests/e2e_tests/test_incentive.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ async def test_incentive(local_chain, subtensor, templates, alice_wallet, bob_wa
8484
async with templates.miner(bob_wallet, netuid):
8585
async with templates.validator(alice_wallet, netuid) as validator:
8686
# wait for the Validator to process and set_weights
87-
async with asyncio.timeout(60):
88-
await validator.set_weights.wait()
87+
await asyncio.wait_for(validator.set_weights.wait(), 60)
8988

9089
# Wait till new epoch
9190
await wait_interval(tempo, subtensor, netuid)

tests/e2e_tests/utils/e2e_test_utils.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ async def __aenter__(self):
116116

117117
self.__reader_task = asyncio.create_task(self._reader())
118118

119-
async with asyncio.timeout(30):
120-
await self.started.wait()
119+
await asyncio.wait_for(self.started.wait(), 30)
121120

122121
return self
123122

@@ -166,8 +165,7 @@ async def __aenter__(self):
166165

167166
self.__reader_task = asyncio.create_task(self._reader())
168167

169-
async with asyncio.timeout(30):
170-
await self.started.wait()
168+
await asyncio.wait_for(self.started.wait(), 30)
171169

172170
return self
173171

0 commit comments

Comments
 (0)