Skip to content

Commit

Permalink
Fix flakiness of cluster-multiple-meets and cluster-reliable-meet (va…
Browse files Browse the repository at this point in the history
…lkey-io#728)

Tests in cluster-multiple-meets were flaky as reported by @madolson 

*
https://github.com/valkey-io/valkey/actions/runs/9688455588/job/26776953320
*
https://github.com/valkey-io/valkey/actions/runs/9688455588/job/26776953585

I wasn't able to reproduce this locally, but I suspect that the
flakiness is coming from the fact that nodes are reported as "connected"
as long as there is an outgoing link. An outgoing link is created before
MEET is sent out.

Signed-off-by: Sankar <[email protected]>
  • Loading branch information
srgsanky authored Jul 2, 2024
1 parent 3323e42 commit eff45f5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion tests/unit/cluster/cluster-multiple-meets.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ tags {tls:skip external:skip cluster} {
}

# 0 will be connected to 1, but 1 won't see that 0 is connected
assert {[llength [get_cluster_nodes 1 connected]] == 1}
# Using a wait condition here as an assert can be flaky - especially
# when cluster nodes is processed when the link is established to send MEET.
wait_for_condition 1000 50 {
[llength [get_cluster_nodes 1 connected]] == 1
} else {
fail "Node 1 recognizes node 0 even though it drops PONGs from node 0"
}
assert {[llength [get_cluster_nodes 0 connected]] == 2}

# Drop incoming and outgoing links from/to 1
Expand Down
8 changes: 7 additions & 1 deletion tests/unit/cluster/cluster-reliable-meet.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ tags {tls:skip external:skip cluster} {
}

# Make sure the nodes still don't know about each other
assert {[llength [get_cluster_nodes 1 connected]] == 1}
# Using a wait condition here as an assert can be flaky - especially
# when cluster nodes is processed when the link is established to send MEET.
wait_for_condition 1000 50 {
[llength [get_cluster_nodes 1 connected]] == 1
} else {
fail "Node 1 recognizes node 0 even though node 0 drops MEETs from node 1"
}
assert {[llength [get_cluster_nodes 0 connected]] == 1}

R 0 DEBUG DROP-CLUSTER-PACKET-FILTER $CLUSTER_PACKET_TYPE_NONE
Expand Down

0 comments on commit eff45f5

Please sign in to comment.