@@ -44,7 +44,7 @@ async def handle_event_yield_only(self):
4444
4545 @rx .event (background = True )
4646 async def fast_yielding (self ):
47- for _ in range (100 ):
47+ for _ in range (1000 ):
4848 yield State .increment ()
4949
5050 @rx .event
@@ -174,6 +174,11 @@ def index() -> rx.Component:
174174 on_click = State .yield_in_async_with_self ,
175175 id = "yield-in-async-with-self" ,
176176 ),
177+ rx .button (
178+ "Fast Yielding" ,
179+ on_click = State .fast_yielding ,
180+ id = "fast-yielding" ,
181+ ),
177182 rx .button ("Reset" , on_click = State .reset_counter , id = "reset" ),
178183 )
179184
@@ -397,11 +402,11 @@ def test_fast_yielding(
397402 assert background_task .app_instance is not None
398403
399404 # get a reference to all buttons
400- fast_yielding_button = driver .find_element (By .ID , "yield-increment " )
405+ fast_yielding_button = driver .find_element (By .ID , "fast-yielding " )
401406
402407 # get a reference to the counter
403408 counter = driver .find_element (By .ID , "counter" )
404409 assert background_task ._poll_for (lambda : counter .text == "0" , timeout = 5 )
405410
406411 fast_yielding_button .click ()
407- assert background_task ._poll_for (lambda : counter .text == "100 " , timeout = 5 )
412+ assert background_task ._poll_for (lambda : counter .text == "1000 " , timeout = 50 )
0 commit comments