From f7217d99dd857f9f8ea668c74e7e497063fa9351 Mon Sep 17 00:00:00 2001 From: Alexey Zatelepin Date: Thu, 7 Mar 2019 21:16:36 +0300 Subject: [PATCH] move test script that caused a crash from bugs/ to tests --- .../00816_concurrent_alter_column.reference | 1 + .../00816_concurrent_alter_column.sh | 21 +++++++++++++++++++ .../bugs/00816_concurrent_alter_column.sh | 18 ---------------- 3 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 dbms/tests/queries/0_stateless/00816_concurrent_alter_column.reference create mode 100755 dbms/tests/queries/0_stateless/00816_concurrent_alter_column.sh delete mode 100755 dbms/tests/queries/bugs/00816_concurrent_alter_column.sh diff --git a/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.reference b/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.reference new file mode 100644 index 00000000000..85dfb778810 --- /dev/null +++ b/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.reference @@ -0,0 +1 @@ +did not crash diff --git a/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.sh b/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.sh new file mode 100755 index 00000000000..c1fc0ebce6a --- /dev/null +++ b/dbms/tests/queries/0_stateless/00816_concurrent_alter_column.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -e + +CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) +. $CURDIR/../shell_config.sh + +echo "DROP TABLE IF EXISTS test.concurrent_alter_column" | ${CLICKHOUSE_CLIENT} +echo "CREATE TABLE test.concurrent_alter_column (ts DATETIME) ENGINE = MergeTree PARTITION BY toStartOfDay(ts) ORDER BY tuple()" | ${CLICKHOUSE_CLIENT} + +for i in {1..500}; do echo "ALTER TABLE test.concurrent_alter_column ADD COLUMN c$i DOUBLE;"; done | ${CLICKHOUSE_CLIENT} -n + +for i in {1..100}; do echo "ALTER TABLE test.concurrent_alter_column ADD COLUMN d DOUBLE" | ${CLICKHOUSE_CLIENT}; sleep `echo 0.0$RANDOM`; echo "ALTER TABLE test.concurrent_alter_column DROP COLUMN d" | ${CLICKHOUSE_CLIENT} -n; done & +for i in {1..100}; do echo "ALTER TABLE test.concurrent_alter_column ADD COLUMN e DOUBLE" | ${CLICKHOUSE_CLIENT}; sleep `echo 0.0$RANDOM`; echo "ALTER TABLE test.concurrent_alter_column DROP COLUMN e" | ${CLICKHOUSE_CLIENT} -n; done & +for i in {1..100}; do echo "ALTER TABLE test.concurrent_alter_column ADD COLUMN f DOUBLE" | ${CLICKHOUSE_CLIENT}; sleep `echo 0.0$RANDOM`; echo "ALTER TABLE test.concurrent_alter_column DROP COLUMN f" | ${CLICKHOUSE_CLIENT} -n; done & + +wait + +echo "DROP TABLE test.concurrent_alter_column" | ${CLICKHOUSE_CLIENT} + +echo 'did not crash' diff --git a/dbms/tests/queries/bugs/00816_concurrent_alter_column.sh b/dbms/tests/queries/bugs/00816_concurrent_alter_column.sh deleted file mode 100755 index 63e8e48e0bb..00000000000 --- a/dbms/tests/queries/bugs/00816_concurrent_alter_column.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -set -e - -CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) -. $CURDIR/../shell_config.sh - -echo "DROP TABLE IF EXISTS test.test" | ${CLICKHOUSE_CLIENT} -echo "CREATE TABLE test.test (ts DATETIME) ENGINE = MergeTree PARTITION BY toStartOfDay(ts) ORDER BY tuple()" | ${CLICKHOUSE_CLIENT} - -for i in {1..500}; do echo "ALTER TABLE test.test ADD COLUMN c$i DOUBLE;"; done | ${CLICKHOUSE_CLIENT} -n - -for i in {1..500}; do echo "ALTER TABLE test.test ADD COLUMN d DOUBLE" | ${CLICKHOUSE_CLIENT}; echo "ALTER TABLE test.test DROP COLUMN d" | ${CLICKHOUSE_CLIENT} -n; done & -for i in {1..500}; do echo "ALTER TABLE test.test ADD COLUMN e DOUBLE" | ${CLICKHOUSE_CLIENT}; echo "ALTER TABLE test.test DROP COLUMN e" | ${CLICKHOUSE_CLIENT} -n; done & - -wait - -echo "DROP TABLE test.test" | ${CLICKHOUSE_CLIENT}