Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
267e25a7
Unverified
Commit
267e25a7
authored
May 03, 2024
by
Daniel Hiltgen
Committed by
GitHub
May 03, 2024
Browse files
Merge pull request #4129 from dhiltgen/unit_tests
Soften timeouts on sched unit tests
parents
e9ae607e
9a32c514
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
server/sched_test.go
server/sched_test.go
+9
-9
No files found.
server/sched_test.go
View file @
267e25a7
...
@@ -58,7 +58,7 @@ func TestInitScheduler(t *testing.T) {
...
@@ -58,7 +58,7 @@ func TestInitScheduler(t *testing.T) {
}
}
func
TestLoad
(
t
*
testing
.
T
)
{
func
TestLoad
(
t
*
testing
.
T
)
{
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Millisecond
)
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
20
*
time
.
Millisecond
)
defer
done
()
defer
done
()
s
:=
InitScheduler
(
ctx
)
s
:=
InitScheduler
(
ctx
)
var
ggml
*
llm
.
GGML
// value not used in tests
var
ggml
*
llm
.
GGML
// value not used in tests
...
@@ -174,7 +174,7 @@ func newScenario(t *testing.T, ctx context.Context, modelName string, estimatedV
...
@@ -174,7 +174,7 @@ func newScenario(t *testing.T, ctx context.Context, modelName string, estimatedV
}
}
func
TestRequests
(
t
*
testing
.
T
)
{
func
TestRequests
(
t
*
testing
.
T
)
{
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
1
00
*
time
.
Millisecond
)
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
5
00
*
time
.
Millisecond
)
defer
done
()
defer
done
()
// Same model, same request
// Same model, same request
...
@@ -329,7 +329,7 @@ func TestRequests(t *testing.T) {
...
@@ -329,7 +329,7 @@ func TestRequests(t *testing.T) {
}
}
func
TestGetRunner
(
t
*
testing
.
T
)
{
func
TestGetRunner
(
t
*
testing
.
T
)
{
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
2
0
*
time
.
Millisecond
)
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
10
0
*
time
.
Millisecond
)
defer
done
()
defer
done
()
// Same model, same request
// Same model, same request
...
@@ -391,7 +391,7 @@ func TestGetRunner(t *testing.T) {
...
@@ -391,7 +391,7 @@ func TestGetRunner(t *testing.T) {
// TODO - add one scenario that triggers the bogus finished event with positive ref count
// TODO - add one scenario that triggers the bogus finished event with positive ref count
func
TestPrematureExpired
(
t
*
testing
.
T
)
{
func
TestPrematureExpired
(
t
*
testing
.
T
)
{
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
1
00
*
time
.
Millisecond
)
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
5
00
*
time
.
Millisecond
)
defer
done
()
defer
done
()
// Same model, same request
// Same model, same request
...
@@ -436,7 +436,7 @@ func TestPrematureExpired(t *testing.T) {
...
@@ -436,7 +436,7 @@ func TestPrematureExpired(t *testing.T) {
}
}
func
TestUseLoadedRunner
(
t
*
testing
.
T
)
{
func
TestUseLoadedRunner
(
t
*
testing
.
T
)
{
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Millisecond
)
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
100
*
time
.
Millisecond
)
req
:=
&
LlmRequest
{
req
:=
&
LlmRequest
{
ctx
:
ctx
,
ctx
:
ctx
,
opts
:
api
.
DefaultOptions
(),
opts
:
api
.
DefaultOptions
(),
...
@@ -461,7 +461,7 @@ func TestUseLoadedRunner(t *testing.T) {
...
@@ -461,7 +461,7 @@ func TestUseLoadedRunner(t *testing.T) {
}
}
func
TestUpdateFreeSpace
(
t
*
testing
.
T
)
{
func
TestUpdateFreeSpace
(
t
*
testing
.
T
)
{
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Millisecond
)
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
100
*
time
.
Millisecond
)
defer
done
()
defer
done
()
gpus
:=
gpu
.
GpuInfoList
{
gpus
:=
gpu
.
GpuInfoList
{
{
{
...
@@ -494,7 +494,7 @@ func TestUpdateFreeSpace(t *testing.T) {
...
@@ -494,7 +494,7 @@ func TestUpdateFreeSpace(t *testing.T) {
}
}
func
TestFindRunnerToUnload
(
t
*
testing
.
T
)
{
func
TestFindRunnerToUnload
(
t
*
testing
.
T
)
{
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Millisecond
)
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
100
*
time
.
Millisecond
)
defer
done
()
defer
done
()
req
:=
&
LlmRequest
{
req
:=
&
LlmRequest
{
ctx
:
ctx
,
ctx
:
ctx
,
...
@@ -518,7 +518,7 @@ func TestFindRunnerToUnload(t *testing.T) {
...
@@ -518,7 +518,7 @@ func TestFindRunnerToUnload(t *testing.T) {
}
}
func
TestNeedsReload
(
t
*
testing
.
T
)
{
func
TestNeedsReload
(
t
*
testing
.
T
)
{
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Millisecond
)
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
100
*
time
.
Millisecond
)
defer
done
()
defer
done
()
llm
:=
&
mockLlm
{}
llm
:=
&
mockLlm
{}
...
@@ -562,7 +562,7 @@ func TestNeedsReload(t *testing.T) {
...
@@ -562,7 +562,7 @@ func TestNeedsReload(t *testing.T) {
}
}
func
TestUnloadAllRunners
(
t
*
testing
.
T
)
{
func
TestUnloadAllRunners
(
t
*
testing
.
T
)
{
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
5
*
time
.
Millisecond
)
ctx
,
done
:=
context
.
WithTimeout
(
context
.
Background
(),
100
*
time
.
Millisecond
)
defer
done
()
defer
done
()
llm1
:=
&
mockLlm
{}
llm1
:=
&
mockLlm
{}
...
...
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