Skip to content

Commit 58df026

Browse files
committed
Add additional logging to e2e
1 parent 3edd286 commit 58df026

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

e2e/newenemy/newenemy_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ func checkDataNoNewEnemy(ctx context.Context, t testing.TB, slowNodeID int, crdb
360360
Updates: []*v1.RelationshipUpdate{blockusers[i]},
361361
})
362362
require.NoError(t, err)
363+
t.Log("r1 token: ", r1.WrittenAt.Token)
363364

364365
// sleeping in between the writes seems to let cockroach clear out
365366
// pending transactions in the background and has a better chance
@@ -373,6 +374,13 @@ func checkDataNoNewEnemy(ctx context.Context, t testing.TB, slowNodeID int, crdb
373374
Updates: []*v1.RelationshipUpdate{allowlists[i]},
374375
})
375376
require.NoError(t, err)
377+
t.Log("r2 token: ", r2.WrittenAt.Token)
378+
379+
z1, _ := zedtoken.DecodeRevision(r1.WrittenAt, revisions.CommonDecoder{Kind: revisions.HybridLogicalClock})
380+
z2, _ := zedtoken.DecodeRevision(r2.WrittenAt, revisions.CommonDecoder{Kind: revisions.HybridLogicalClock})
381+
382+
t.Log("z1 revision: ", z1)
383+
t.Log("z2 revision: ", z2)
376384

377385
canHas, err := spicedb[1].Client().V1().Permissions().CheckPermission(context.Background(), &v1.CheckPermissionRequest{
378386
Consistency: &v1.Consistency{Requirement: &v1.Consistency_AtExactSnapshot{AtExactSnapshot: r2.WrittenAt}},
@@ -396,8 +404,6 @@ func checkDataNoNewEnemy(ctx context.Context, t testing.TB, slowNodeID int, crdb
396404
ns2AllowlistLeader := getLeaderNodeForNamespace(ctx, crdb[2].Conn(), allowlists[i].Relationship.Subject.Object.ObjectType)
397405

398406
r1leader, r2leader := getLeaderNode(ctx, crdb[2].Conn(), blockusers[i].Relationship), getLeaderNode(ctx, crdb[2].Conn(), allowlists[i].Relationship)
399-
z1, _ := zedtoken.DecodeRevision(r1.WrittenAt, revisions.CommonDecoder{Kind: revisions.HybridLogicalClock})
400-
z2, _ := zedtoken.DecodeRevision(r2.WrittenAt, revisions.CommonDecoder{Kind: revisions.HybridLogicalClock})
401407
t.Log(sleep, z1, z2, z1.GreaterThan(z2), r1leader, r2leader, ns1BlocklistLeader, ns1UserLeader, ns2ResourceLeader, ns2AllowlistLeader)
402408

403409
if z1.GreaterThan(z2) {

0 commit comments

Comments
 (0)