Deflake the domain-expiry test !53

merged merged by cmc on 2026-08-25 19:07 UTC · krz/gitbay:fix-expiry-flake into main

1 file changed, +4 −1

Layout: unified · split

e2e/pages_test.go +4 −1
@@ -263,7 +263,10 @@ func TestPages(t *testing.T) {
263 if _, _, code = inst.ssh(t, bobKey, "", "repo", "domain", "add", "bob/held", "exp.example.org"); code != 2 { 263 if _, _, code = inst.ssh(t, bobKey, "", "repo", "domain", "add", "bob/held", "exp.example.org"); code != 2 {
264 t.Fatal("live pending claim did not hold the name") 264 t.Fatal("live pending claim did not hold the name")
265 } 265 }
266 time.Sleep(5500 * time.Millisecond) // one TTL (GITBAY_DOMAIN_PENDING_TTL=5s) plus slack 266 // One TTL (GITBAY_DOMAIN_PENDING_TTL=5s) plus real slack: timestamps
267 // have second granularity, so a 5.5s sleep can land on a diff of
268 // exactly 5, which is not > TTL.
269 time.Sleep(7 * time.Second)
267 if _, errOut, code = inst.ssh(t, bobKey, "", "repo", "domain", "add", "bob/held", "exp.example.org"); code != 0 { 270 if _, errOut, code = inst.ssh(t, bobKey, "", "repo", "domain", "add", "bob/held", "exp.example.org"); code != 0 {
268 t.Fatalf("expired claim still held the name: %s", errOut) 271 t.Fatalf("expired claim still held the name: %s", errOut)
269 } 272 }