forked from phoenix/litellm-mirror
(test) bedrock timeout
This commit is contained in:
parent
6dc7ded1a6
commit
2c116af596
1 changed files with 22 additions and 0 deletions
|
@ -37,6 +37,28 @@ def test_timeout():
|
|||
# test_timeout()
|
||||
|
||||
|
||||
def test_bedrock_timeout():
|
||||
# this Will Raise a timeout
|
||||
litellm.set_verbose = True
|
||||
try:
|
||||
response = litellm.completion(
|
||||
model="bedrock/anthropic.claude-instant-v1",
|
||||
timeout=0.01,
|
||||
messages=[{"role": "user", "content": "hello, write a 20 pg essay"}],
|
||||
)
|
||||
pytest.fail("Did not raise error `openai.APITimeoutError`")
|
||||
except openai.APITimeoutError as e:
|
||||
print(
|
||||
"Passed: Raised correct exception. Got openai.APITimeoutError\nGood Job", e
|
||||
)
|
||||
print(type(e))
|
||||
pass
|
||||
except Exception as e:
|
||||
pytest.fail(
|
||||
f"Did not raise error `openai.APITimeoutError`. Instead raised error type: {type(e)}, Error: {e}"
|
||||
)
|
||||
|
||||
|
||||
def test_hanging_request_azure():
|
||||
litellm.set_verbose = True
|
||||
import asyncio
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue