Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
5588d770
Unverified
Commit
5588d770
authored
Dec 05, 2025
by
Biswa Panda
Committed by
GitHub
Dec 06, 2025
Browse files
test: add timeout for lora utils tests (#4781)
parent
d66e6755
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
lib/bindings/python/tests/test_lora_utils.py
lib/bindings/python/tests/test_lora_utils.py
+6
-0
No files found.
lib/bindings/python/tests/test_lora_utils.py
View file @
5588d770
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
import
pytest
from
dynamo.llm
import
lora_name_to_id
max_int32
=
0x7FFFFFFF
class
TestLoraNameToId
:
@
pytest
.
mark
.
timeout
(
5
)
def
test_import_function
(
self
):
assert
callable
(
lora_name_to_id
)
@
pytest
.
mark
.
timeout
(
5
)
def
test_returns_positive_integer_for_different_names
(
self
):
for
i
in
range
(
100
):
result
=
lora_name_to_id
(
f
"test_lora_
{
i
}
"
)
assert
isinstance
(
result
,
int
)
assert
1
<=
result
<=
max_int32
@
pytest
.
mark
.
timeout
(
5
)
def
test_different_names_produce_different_ids
(
self
):
id1
=
lora_name_to_id
(
"lora_adapter_1"
)
id2
=
lora_name_to_id
(
"lora_adapter_2"
)
assert
id1
!=
id2
@
pytest
.
mark
.
timeout
(
5
)
def
test_consistency_across_multiple_calls
(
self
):
test_names
=
[
f
"lora_
{
i
}
"
for
i
in
range
(
100
)]
results_first
=
[
lora_name_to_id
(
name
)
for
name
in
test_names
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment