Fix flaky test 00816_long_concurrent_alter_column

This commit is contained in:
Alexey Milovidov 2021-04-05 00:34:51 +03:00
parent b1e7624b3f
commit b07d53640c

View File

@ -60,16 +60,10 @@ wait
echo "DROP TABLE concurrent_alter_column NO DELAY" | ${CLICKHOUSE_CLIENT} # NO DELAY has effect only for Atomic database
db_engine=`$CLICKHOUSE_CLIENT -q "SELECT engine FROM system.databases WHERE name='$CLICKHOUSE_DATABASE'"`
if [[ $db_engine == "Atomic" ]]; then
# DROP is non-blocking, so wait for alters
# Wait for alters and check for deadlocks (in case of deadlock this loop will not finish)
while true; do
$CLICKHOUSE_CLIENT -q "SELECT c = 0 FROM (SELECT count() as c FROM system.processes WHERE query_id LIKE 'alter_00816_%')" | grep 1 > /dev/null && break;
echo "SELECT * FROM system.processes WHERE query_id LIKE 'alter\\_00816\\_%'" | ${CLICKHOUSE_CLIENT} | grep -q -F 'alter' || break
sleep 1;
done
fi
# Check for deadlocks
echo "SELECT * FROM system.processes WHERE query_id LIKE 'alter_00816_%'" | ${CLICKHOUSE_CLIENT}
echo 'did not crash'