From 11e2df9b3d816b9693f7a79ac713f584c40bf7c6 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 10 Dec 2024 17:15:38 -0500 Subject: [PATCH] WIP: debug test failure --- internal/datastore/postgres/locks.go | 8 +++++++- pkg/datastore/test/revisions.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/internal/datastore/postgres/locks.go b/internal/datastore/postgres/locks.go index 86863e926c..076425d4cf 100644 --- a/internal/datastore/postgres/locks.go +++ b/internal/datastore/postgres/locks.go @@ -1,6 +1,9 @@ package postgres -import "context" +import ( + "context" + "fmt" +) type lockID uint32 @@ -17,8 +20,11 @@ func (pgd *pgDatastore) tryAcquireLock(ctx context.Context, lockID lockID) (bool var lockAcquired bool if err := row.Scan(&lockAcquired); err != nil { + fmt.Printf("Error acquiring lock: %v\n", err) return false, err } + + fmt.Printf("Lock acquired: %v\n", lockAcquired) return lockAcquired, nil } diff --git a/pkg/datastore/test/revisions.go b/pkg/datastore/test/revisions.go index 63dbd6f4fc..0354329997 100644 --- a/pkg/datastore/test/revisions.go +++ b/pkg/datastore/test/revisions.go @@ -131,7 +131,7 @@ func RevisionGCTest(t *testing.T, tester DatastoreTester) { gcable, ok := ds.(common.GarbageCollector) if ok { gcable.ResetGCCompleted() - require.Eventually(func() bool { return gcable.HasGCRun() }, 10*time.Second, 100*time.Millisecond, "GC was never run as expected") + require.Eventually(func() bool { return gcable.HasGCRun() }, 5*time.Second, 50*time.Millisecond, "GC was never run as expected") } // FIXME currently the various datastores behave differently when a revision was requested and GC Window elapses.