mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-25 17:12:16 +00:00
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
This commit is contained in:
parent
6827d63e30
commit
da2b083025
@ -160,15 +160,15 @@ RSpec.describe AiTool do
|
||||
}
|
||||
JS
|
||||
|
||||
tool = create_tool(script: script)
|
||||
runner = tool.runner({ "query" => "test" }, llm: nil, bot_user: nil, context: {})
|
||||
|
||||
stub_request(:get, "https://example.com/test").to_return do
|
||||
sleep 0.01
|
||||
{ status: 200, body: "Hello World", headers: {} }
|
||||
end
|
||||
|
||||
runner.timeout = 5
|
||||
tool = create_tool(script: script)
|
||||
runner = tool.runner({ "query" => "test" }, llm: nil, bot_user: nil, context: {})
|
||||
|
||||
runner.timeout = 10
|
||||
|
||||
result = runner.invoke
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user