Skip to content

Commit

Permalink
Merge pull request #108557 from AlexTalks/backport22.2-107140
Browse files Browse the repository at this point in the history
release-22.2: acceptance: deflake test_demo_node_cmds
  • Loading branch information
AlexTalks authored Aug 16, 2023
2 parents 1882b00 + e8a9995 commit 211ac9d
Showing 1 changed file with 26 additions and 32 deletions.
58 changes: 26 additions & 32 deletions pkg/cli/interactive_tests/test_demo_node_cmds.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -64,31 +64,26 @@ send "\\demo restart 3\r"
eexpect "node 3 has been restarted"
eexpect "movr>"

# NB: this is flaky, sometimes n3 is still marked as draining due to
# gossip propagation delays. See:
# https://github.com/cockroachdb/cockroach/issues/76391
# send "select node_id, draining, decommissioning, membership from crdb_internal.gossip_liveness ORDER BY node_id;\r"
# eexpect "1 | false | false | active"
# eexpect "2 | false | false | active"
# eexpect "3 | false | false | active"
# eexpect "4 | false | false | active"
# eexpect "5 | false | false | active"
# eexpect "movr>"

# Try commissioning commands
send "select node_id, draining, decommissioning, membership from crdb_internal.gossip_liveness ORDER BY node_id;\r"
eexpect "1 | f | f | active"
eexpect "2 | f | f | active"
eexpect "3 | f | f | active"
eexpect "4 | f | f | active"
eexpect "5 | f | f | active"
eexpect "movr>"

# Try decommissioning commands
send "\\demo decommission 4\r"
eexpect "node 4 has been decommissioned"
eexpect "movr>"

# NB: skipping this out of an abundance of caution, see:
# https://github.com/cockroachdb/cockroach/issues/76391
# send "select node_id, draining, decommissioning, membership from crdb_internal.gossip_liveness ORDER BY node_id;\r"
# eexpect "1 | false | false | active"
# eexpect "2 | false | false | active"
# eexpect "3 | false | false | active"
# eexpect "4 | false | true | decommissioned"
# eexpect "5 | false | false | active"
# eexpect "movr>"
send "select node_id, draining, membership from crdb_internal.kv_node_liveness ORDER BY node_id;\r"
eexpect "1 | f | active"
eexpect "2 | f | active"
eexpect "3 | f | active"
eexpect "4 | f | decommissioned"
eexpect "5 | f | active"
eexpect "movr>"

send "\\demo recommission 4\r"
eexpect "can only recommission a decommissioning node"
Expand Down Expand Up @@ -123,17 +118,16 @@ send "\\demo shutdown 6\r"
eexpect "node 6 has been shutdown"
eexpect "movr>"

# By now the node should have stabilized in gossip which allows us to query the more detailed information there.
# NB: skip this to avoid flakes, see:
# https://github.com/cockroachdb/cockroach/issues/76391
# send "select node_id, draining, decommissioning, membership from crdb_internal.gossip_liveness ORDER BY node_id;\r"
# eexpect "1 | false | false | active"
# eexpect "2 | false | false | active"
# eexpect "3 | false | false | active"
# eexpect "4 | false | true | decommissioned"
# eexpect "5 | false | false | active"
# eexpect "6 | true | false | active"
# eexpect "movr>"
# NB: use kv_node_liveness to avoid flakes due to gossip delays.
# See https://github.com/cockroachdb/cockroach/issues/76391
send "select node_id, draining, membership from crdb_internal.kv_node_liveness ORDER BY node_id;\r"
eexpect "1 | f | active"
eexpect "2 | f | active"
eexpect "3 | f | active"
eexpect "4 | f | decommissioned"
eexpect "5 | f | active"
eexpect "6 | t | active"
eexpect "movr>"

send_eof
eexpect eof
Expand Down

0 comments on commit 211ac9d

Please sign in to comment.