diff --git a/integration/embed_test.go b/integration/embed_test.go index e45066739..57c8b9b97 100644 --- a/integration/embed_test.go +++ b/integration/embed_test.go @@ -73,13 +73,18 @@ func manhattanDistance[V float32 | float64](v1, v2 []V) V { } func TestEmbedCosineDistanceCorrelation(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + softTimeout, hardTimeout := getTimeouts(t) + ctx, cancel := context.WithTimeout(context.Background(), hardTimeout) defer cancel() client, _, cleanup := InitServerConnection(ctx, t) defer cleanup() + started := time.Now() for _, model := range libraryEmbedModels { t.Run(model, func(t *testing.T) { + if time.Since(started) > softTimeout { + t.Skip("skipping - soft timeout exceeded") + } testCases := []struct { a string b string @@ -489,14 +494,19 @@ func TestEmbedTruncation(t *testing.T) { // TestEmbedLargeInput tests that embedding models can handle large inputs that would exceed typical batch sizes. func TestEmbedLargeInput(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute) + softTimeout, hardTimeout := getTimeouts(t) + ctx, cancel := context.WithTimeout(context.Background(), hardTimeout) defer cancel() client, _, cleanup := InitServerConnection(ctx, t) defer cleanup() + started := time.Now() for _, model := range libraryEmbedModels { model := model t.Run(model, func(t *testing.T) { + if time.Since(started) > softTimeout { + t.Skip("skipping - soft timeout exceeded") + } mctx, mcancel := context.WithTimeout(ctx, 2*time.Minute) defer mcancel() diff --git a/integration/tools_test.go b/integration/tools_test.go index 39b3e1a91..193706187 100644 --- a/integration/tools_test.go +++ b/integration/tools_test.go @@ -21,9 +21,10 @@ func testPropsMap(m map[string]api.ToolProperty) *api.ToolPropertiesMap { } func TestAPIToolCalling(t *testing.T) { - initialTimeout := 60 * time.Second - streamTimeout := 60 * time.Second - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) + initialTimeout := 90 * time.Second + streamTimeout := 90 * time.Second + softTimeout, hardTimeout := getTimeouts(t) + ctx, cancel := context.WithTimeout(context.Background(), hardTimeout) defer cancel() client, _, cleanup := InitServerConnection(ctx, t) @@ -47,8 +48,12 @@ func TestAPIToolCalling(t *testing.T) { "granite3.3": 7, } + started := time.Now() for _, model := range libraryToolsModels { t.Run(model, func(t *testing.T) { + if time.Since(started) > softTimeout { + t.Skip("skipping - soft timeout exceeded") + } if v, ok := minVRAM[model]; ok { skipUnderMinVRAM(t, v) }