File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1243,6 +1243,7 @@ func TestDirectorRegistration(t *testing.T) {
12431243 t .Run ("future-to-active-toggle" , func (t * testing.T ) {
12441244 teardown ()
12451245 c , r , w := setupContext ()
1246+ now := time .Now ().UTC ().UnixMilli ()
12461247
12471248 pKey , token , _ := generateToken ()
12481249 pub , err := jwk .PublicKeyOf (pKey )
@@ -1267,7 +1268,10 @@ func TestDirectorRegistration(t *testing.T) {
12671268 // 2) now active
12681269 ad2 := baseAd
12691270 ad2 .Downtimes = []server_structs.Downtime {
1270- makeDT (now - 1_000 , now + 1_000 ),
1271+ // A new active downtime with 20s (+/-10s) window to prevent it expiring
1272+ // before the server ad gets to the Director, which results in a flaky test.
1273+ // This should clear the previous future downtime.
1274+ makeDT (now - 10_000 , now + 10_000 ),
12711275 }
12721276 ad2 .Initialize ("test-cache" )
12731277 body2 , _ := json .Marshal (ad2 )
You can’t perform that action at this time.
0 commit comments