test: make app window freshness check deterministic
This commit is contained in:
1 parent
e281e43d07
commit
d36d3ed0d6
1 file changed
+4
-1
@@ -89,7 +89,10 @@ func TestActiveWindowReporting(t *testing.T) {
|
||||
if got, ok := srv.ActiveWindow("mac-one", time.Second); !ok || got != window {
|
||||
t.Fatalf("active window = %+v, %t", got, ok)
|
||||
}
|
||||
if _, ok := srv.ActiveWindow("mac-one", 0); ok {
|
||||
srv.mu.Lock()
|
||||
srv.vms["mac-one"].windowReport.receivedAt = time.Now().Add(-2 * time.Second)
|
||||
srv.mu.Unlock()
|
||||
if _, ok := srv.ActiveWindow("mac-one", time.Second); ok {
|
||||
t.Fatal("report older than maxAge was accepted")
|
||||
}
|
||||
if _, ok := srv.ActiveWindow("mac-two", time.Second); ok {
|
||||
|
||||
Reference in new issue
Block a user