File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -28,3 +28,25 @@ test "Different nodes have different IDs" {
2828 set numids [llength [lsort -unique $ids ]]
2929 assert {$numids == $numnodes }
3030}
31+
32+ test " Check if nodes auto-discovery works" {
33+ # Join node 0 with 1, 1 with 2, ... and so forth.
34+ # If auto-discovery works all nodes will know every other node
35+ # eventually.
36+ set ids {}
37+ foreach_redis_id id {lappend ids $id }
38+ for {set j 0} {$j < [expr [llength $ids ]-1]} {incr j} {
39+ set a [lindex $ids $j ]
40+ set b [lindex $ids [expr $j +1]]
41+ set b_port [get_instance_attrib redis $b port]
42+ R $a cluster meet 127.0.0.1 $b_port
43+ }
44+
45+ foreach_redis_id id {
46+ wait_for_condition 1000 50 {
47+ [llength [get_cluster_nodes $id ]] == [llength $ids ]
48+ } else {
49+ fail " Cluster failed to join into a full mesh."
50+ }
51+ }
52+ }
You can’t perform that action at this time.
0 commit comments