@@ -541,11 +541,11 @@ async def async_func(x):
541541 async_func .clear_cache ()
542542
543543 async def test_stale_entry_being_processed_with_next_time (self ):
544- """
545- Test concurrent calls with stale cache and next_time=True return stale values.
546-
547- When cache is stale and next_time=True, concurrent calls should return
548- the stale value while background recalculation happens.
544+ """Test concurrent calls with stale cache and next_time=True return stale values.
545+
546+ When cache is stale and next_time=True, concurrent calls should return the stale value while background
547+ recalculation happens.
548+
549549 """
550550 call_count = 0
551551
@@ -569,21 +569,21 @@ async def slow_async_func(x):
569569
570570 # Start a slow recalculation in background (don't await it yet)
571571 task1 = asyncio .create_task (slow_async_func (5 ))
572-
572+
573573 # Give it a moment to mark entry as being processed
574574 await asyncio .sleep (0.1 )
575-
575+
576576 # Now make another call while first one is still processing
577577 # This should return the stale value because entry._processing=True and next_time=True
578578 result2 = await slow_async_func (5 )
579579 assert result2 == 10 # Should return stale value
580-
580+
581581 # Wait for background task to complete
582582 await task1
583-
583+
584584 # Wait enough time for the background update to complete and cache to be updated
585585 await asyncio .sleep (1.5 )
586-
586+
587587 # Next call should get an updated value (could be 20 or 30 depending on background tasks)
588588 result3 = await slow_async_func (5 )
589589 assert result3 > 10 # Should be updated from background
@@ -977,6 +977,3 @@ async def async_func_large_result(x):
977977 assert "Result exceeds entry_size_limit; not cached" in captured .out
978978
979979 async_func_large_result .clear_cache ()
980-
981-
982-
0 commit comments