Skip to content

Commit

Permalink
demo: Add test to verify workload is running with --with-load
Browse files Browse the repository at this point in the history
Adds a test ensuring the workload starts up when running
`cockroach demo movr --with-load`

Release note: None
  • Loading branch information
Rohan Yadav committed Sep 12, 2019
1 parent 0003d2e commit 467280f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pkg/cli/interactive_tests/test_demo_workload.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#! /usr/bin/env expect -f

source [file join [file dirname $argv0] common.tcl]

start_test "Check cockroach demo --with-load runs the movr workload"

# Start demo with movr and the movr workload.
spawn $argv demo movr --with-load

eexpect "movr>"

# Try a few times, but expect that we eventually see the workload
# queries show up as the highest count queries in the system.

for {set i 0} {$i < 10} {incr i} {
send "select key from crdb_internal.node_statement_statistics order by count desc limit 1;\r"
# Sleep a little bit to let the workload catch up.
sleep 1
}

eexpect "SELECT city, id FROM vehicles WHERE city = \$1"

interrupt
end_test

0 comments on commit 467280f

Please sign in to comment.