Skip to content

Commit

Permalink
WIP: debug test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
josephschorr committed Dec 10, 2024
1 parent d5c323b commit 11e2df9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion internal/datastore/postgres/locks.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package postgres

import "context"
import (
"context"
"fmt"
)

type lockID uint32

Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/datastore/test/revisions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 11e2df9

Please sign in to comment.