Skip to content

Commit 9505451

Browse files
KRRT7claude
andcommitted
fix: revert async e2e fixture to use time.sleep() for optimization target
The e2e test expects codeflash to detect and fix the intentional use of blocking time.sleep() in an async function. Using asyncio.sleep() removes the optimization opportunity and causes the CI job to fail. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e086121 commit 9505451

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

  • code_to_optimize/code_directories/async_e2e
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1+
import time
12
import asyncio
23

34

45
async def retry_with_backoff(func, max_retries=3):
56
if max_retries < 1:
67
raise ValueError("max_retries must be at least 1")
78
last_exception = None
8-
_sleep = asyncio.sleep
99
for attempt in range(max_retries):
1010
try:
1111
return await func()
1212
except Exception as e:
1313
last_exception = e
1414
if attempt < max_retries - 1:
15-
delay = 0.0001 * attempt
16-
if delay:
17-
await _sleep(delay)
15+
time.sleep(0.0001 * attempt)
1816
raise last_exception

0 commit comments

Comments
 (0)