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
6e8529fd
Unverified
Commit
6e8529fd
authored
Oct 10, 2025
by
Yan Ru Pei
Committed by
GitHub
Oct 10, 2025
Browse files
test: unit test for Router slot manager (#3559)
Signed-off-by:
PeaBrane
<
yanrpei@gmail.com
>
parent
a3d46840
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
lib/llm/src/kv_router/sequence.rs
lib/llm/src/kv_router/sequence.rs
+30
-0
No files found.
lib/llm/src/kv_router/sequence.rs
View file @
6e8529fd
...
...
@@ -868,6 +868,36 @@ mod tests {
use
dynamo_runtime
::{
DistributedRuntime
,
Runtime
};
use
std
::
sync
::
Arc
;
#[test]
fn
test_active_sequences_shared_blocks
()
{
let
block_size
=
4
;
let
mut
seq_manager
=
ActiveSequences
::
new
(
block_size
);
seq_manager
.add_request
(
"request_1"
.to_string
(),
Some
(
vec!
[
1
,
2
,
3
]),
12
,
0
);
assert_eq!
(
seq_manager
.active_blocks
(),
3
);
assert_eq!
(
seq_manager
.active_tokens
(),
12
);
seq_manager
.add_request
(
"request_2"
.to_string
(),
Some
(
vec!
[
4
]),
4
,
0
);
assert_eq!
(
seq_manager
.active_blocks
(),
4
);
assert_eq!
(
seq_manager
.active_tokens
(),
16
);
seq_manager
.add_request
(
"request_3"
.to_string
(),
Some
(
vec!
[
1
,
2
,
3
,
4
]),
16
,
4
);
assert_eq!
(
seq_manager
.active_blocks
(),
4
);
assert_eq!
(
seq_manager
.active_tokens
(),
16
);
seq_manager
.free
(
&
"request_2"
.to_string
());
assert_eq!
(
seq_manager
.active_blocks
(),
4
);
assert_eq!
(
seq_manager
.active_tokens
(),
12
);
seq_manager
.free
(
&
"request_3"
.to_string
());
assert_eq!
(
seq_manager
.active_blocks
(),
3
);
assert_eq!
(
seq_manager
.active_tokens
(),
12
);
seq_manager
.free
(
&
"request_1"
.to_string
());
assert_eq!
(
seq_manager
.active_blocks
(),
0
);
assert_eq!
(
seq_manager
.active_tokens
(),
0
);
}
#[tokio::test]
#[ignore]
async
fn
test_multi_worker_cross_instance_sync
()
->
Result
<
()
>
{
...
...
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