File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -133,9 +133,11 @@ def test_client_retry_after_seconds
133133 end
134134
135135 def test_client_retry_after_date
136+ time_now = Time . now
137+
136138 stub_request ( :post , "http://localhost/v1/sessions/start" ) . to_return_json (
137139 status : 500 ,
138- headers : { "retry-after" => ( Time . now + 10 ) . httpdate } ,
140+ headers : { "retry-after" => ( time_now + 10 ) . httpdate } ,
139141 body : { }
140142 )
141143
@@ -148,11 +150,11 @@ def test_client_retry_after_date
148150 max_retries : 1
149151 )
150152
153+ Thread . current . thread_variable_set ( :time_now , time_now )
151154 assert_raises ( Stagehand ::Errors ::InternalServerError ) do
152- Thread . current . thread_variable_set ( :time_now , Time . now )
153155 stagehand . sessions . start ( model_name : "openai/gpt-4o" )
154- Thread . current . thread_variable_set ( :time_now , nil )
155156 end
157+ Thread . current . thread_variable_set ( :time_now , nil )
156158
157159 assert_requested ( :any , /./ , times : 2 )
158160 assert_in_delta ( 10 , Thread . current . thread_variable_get ( :mock_sleep ) . last , 1.0 )
You can’t perform that action at this time.
0 commit comments