Skip to content

Commit e09ac21

Browse files
committed
Refactored the psync2 test
Signed-off-by: Hanxi Zhang <hanxizh@amazon.com>
1 parent cadd989 commit e09ac21

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

tests/unit/hashexpire.tcl

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4611,22 +4611,15 @@ start_server {} {
46114611
$primary debug set-active-expire 0
46124612

46134613
# Create hash with expiring fields and one permanent field
4614-
$primary hsetex myhash PX 1000 FIELDS 3 f1 v1 f2 v2 f3 v3
4614+
$primary hsetex myhash PX 1 FIELDS 3 f1 v1 f2 v2 f3 v3
46154615
$primary hset myhash permanent permanent_value
46164616

46174617
# Wait for replica to sync
4618-
wait_for_condition 50 100 {
4619-
[$replica hlen myhash] == 4 &&
4620-
[$sub_replica hlen myhash] == 4
4621-
} else {
4622-
fail "Replicas did not receive hash"
4623-
}
4618+
wait_for_ofs_sync $primary $replica
46244619

46254620
# Wait until all fields are expired
46264621
wait_for_condition 50 100 {
4627-
[lindex [$primary httl myhash FIELDS 1 f1] 0] == -2 &&
4628-
[lindex [$primary httl myhash FIELDS 1 f2] 0] == -2 &&
4629-
[lindex [$primary httl myhash FIELDS 1 f3] 0] == -2
4622+
[$primary httl myhash FIELDS 3 f1 f2 f3] eq {-2 -2 -2}
46304623
} else {
46314624
fail "Hash fields did not expire"
46324625
}

0 commit comments

Comments
 (0)