updates on the airegistry and controllers and test files are been integrated
This commit is contained in:
20
controllers/aiStatus_test.go
Normal file
20
controllers/aiStatus_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Without Redis (as in this test binary) the in-process stamp still works, so
|
||||
// a single replica reports the engine's reads correctly.
|
||||
func TestRegistryReadStampWithoutRedis(t *testing.T) {
|
||||
lastRegistryRead.Store(0)
|
||||
if registryLastRead() != nil {
|
||||
t.Fatal("no read yet must report nil")
|
||||
}
|
||||
markRegistryRead()
|
||||
got := registryLastRead()
|
||||
if got == nil || time.Since(*got) > 5*time.Second {
|
||||
t.Fatalf("stamp not recorded: %v", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user