fix(laya): extend shared CPU ranking timeout
This commit is contained in:
@ -17,7 +17,7 @@ func TestLayaEnvironment(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if cfg.LayaURL != "http://laya:8000" || cfg.LayaTimeout != 120*time.Second {
|
||||
if cfg.LayaURL != "http://laya:8000" || cfg.LayaTimeout != 5*time.Minute {
|
||||
t.Fatal("incorrect Laya defaults")
|
||||
}
|
||||
t.Setenv("LAYA_URL", "http://127.0.0.1:8001")
|
||||
@ -27,7 +27,12 @@ func TestLayaEnvironment(t *testing.T) {
|
||||
if err != nil || cfg.LayaURL != "http://127.0.0.1:8001" || cfg.LayaTimeout != 45*time.Second || cfg.LayaAPIKey != "test-secret" {
|
||||
t.Fatalf("environment not loaded: %v", err)
|
||||
}
|
||||
for _, value := range []string{"invalid", "0s", "-1s", "11m"} {
|
||||
t.Setenv("LAYA_TIMEOUT", "10m")
|
||||
cfg, err = Load()
|
||||
if err != nil || cfg.LayaTimeout != 10*time.Minute {
|
||||
t.Fatalf("maximum override rejected: %v", err)
|
||||
}
|
||||
for _, value := range []string{"invalid", "0s", "-1s", "11m", "10m1ns"} {
|
||||
t.Setenv("LAYA_TIMEOUT", value)
|
||||
if _, err := Load(); err == nil {
|
||||
t.Errorf("accepted timeout %s", value)
|
||||
|
||||
Reference in New Issue
Block a user