Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit da2b083

Browse files
authored
FIX: attempt to fix flaky (#1226)
The AI Tool spec that checks that the tool runner will not timeout on slow HTTP request is flaky. In this PR we attempt to resolve the flakiness by: Ensuring stub_request runs before the request Increasing the timeout for CI env
1 parent 6827d63 commit da2b083

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spec/models/ai_tool_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,15 @@ def create_tool(
160160
}
161161
JS
162162

163-
tool = create_tool(script: script)
164-
runner = tool.runner({ "query" => "test" }, llm: nil, bot_user: nil, context: {})
165-
166163
stub_request(:get, "https://example.com/test").to_return do
167164
sleep 0.01
168165
{ status: 200, body: "Hello World", headers: {} }
169166
end
170167

171-
runner.timeout = 5
168+
tool = create_tool(script: script)
169+
runner = tool.runner({ "query" => "test" }, llm: nil, bot_user: nil, context: {})
170+
171+
runner.timeout = 10
172172

173173
result = runner.invoke
174174

0 commit comments

Comments
 (0)