fix(slurm): add default 30s timeout to HTTP client
Replaces http.DefaultClient with a client that has a 30s timeout to prevent indefinite hangs when the Slurm REST API is unresponsive. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -2,7 +2,6 @@ package slurm
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
@@ -61,8 +60,8 @@ func TestNewClientWithOpts_BackwardCompatible(t *testing.T) {
|
||||
if client == nil {
|
||||
t.Fatal("expected non-nil client")
|
||||
}
|
||||
if client.client != http.DefaultClient {
|
||||
t.Error("expected http.DefaultClient when no options provided")
|
||||
if client.client.Timeout != DefaultTimeout {
|
||||
t.Errorf("expected Timeout=%v, got %v", DefaultTimeout, client.client.Timeout)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user