Files
wehub-resource-sync 5357c39144
Fuzzer / Run Fuzzer (push) Has been cancelled
Race tests / Go race tests (ubuntu-22.04) (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 13:01:40 +08:00

37 lines
835 B
Bash

#!/usr/bin/env bats
load $BATS_TEST_DIRNAME/helper/common.bash
setup() {
setup_common
}
SLEEP_PID=
teardown() {
if [ -n "$SLEEP_PID" ]; then
kill $SLEEP_PID 2>/dev/null || true
wait $SLEEP_PID 2>/dev/null || true
SLEEP_PID=
fi
teardown_common
}
@test "processlist: kill query" {
if [ "$SQL_ENGINE" != "remote-engine" ]; then
skip "processlist is remote-engine specific"
fi
dolt sql -q "select sleep(1000)" &
SLEEP_PID=$!
sleep 1
run dolt sql -q "SHOW PROCESSLIST"
[[ "$output" =~ "select sleep(1000)" ]] || false
qpid=$(dolt sql -q "show processlist" | grep --text "select sleep(1000)" | cut -d"|" -f2)
run dolt sql -q "kill query $qpid"
sleep 1
run dolt sql -q "SHOW PROCESSLIST"
[[ ! "$output" =~ "select sleep(1000)" ]] || false
}