From 770066960c96986c4b0b919e24dcd84bc31b5471 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov Date: Wed, 1 Apr 2020 19:05:33 +0300 Subject: [PATCH] Fix some tests for random execution order. Found in MemorySanitizer CI run, by virtue of it running the tests in random order. --- dbms/tests/config/decimals_dictionary.xml | 10 +++++----- dbms/tests/config/ints_dictionary.xml | 12 +++++------ dbms/tests/config/strings_dictionary.xml | 14 ++++++------- .../queries/0_stateless/00950_dict_get.sql | 20 ++++++++++++------- 4 files changed, 31 insertions(+), 25 deletions(-) diff --git a/dbms/tests/config/decimals_dictionary.xml b/dbms/tests/config/decimals_dictionary.xml index ff465b91b85..f728fa774a7 100644 --- a/dbms/tests/config/decimals_dictionary.xml +++ b/dbms/tests/config/decimals_dictionary.xml @@ -7,7 +7,7 @@ 9000 default - test_00950 + system decimals
@@ -45,7 +45,7 @@ 9000 default - test_00950 + system decimals
@@ -83,7 +83,7 @@ 9000 default - test_00950 + system decimals
@@ -121,7 +121,7 @@ 9000 default - test_00950 + system decimals
@@ -162,7 +162,7 @@ 9000 default - test_00950 + system decimals
diff --git a/dbms/tests/config/ints_dictionary.xml b/dbms/tests/config/ints_dictionary.xml index 5cf8419ad77..a22dab8933c 100644 --- a/dbms/tests/config/ints_dictionary.xml +++ b/dbms/tests/config/ints_dictionary.xml @@ -7,7 +7,7 @@ 9000 default - test_00950 + system ints
@@ -70,7 +70,7 @@ 9000 default - test_00950 + system ints
@@ -133,7 +133,7 @@ 9000 default - test_00950 + system ints
@@ -196,7 +196,7 @@ 9000 default - test_00950 + system ints
@@ -259,7 +259,7 @@ 9000 default - test_00950 + system ints
@@ -325,7 +325,7 @@ 9000 default - test_00950 + system ints
diff --git a/dbms/tests/config/strings_dictionary.xml b/dbms/tests/config/strings_dictionary.xml index 88fad6ae2d7..c5643eecb68 100644 --- a/dbms/tests/config/strings_dictionary.xml +++ b/dbms/tests/config/strings_dictionary.xml @@ -7,7 +7,7 @@ 9000 default - test_00950 + system strings
@@ -35,7 +35,7 @@ 9000 default - test_00950 + system strings
@@ -63,7 +63,7 @@ 9000 default - test_00950 + system strings
@@ -91,7 +91,7 @@ 9000 default - test_00950 + system strings
@@ -122,7 +122,7 @@ 9000 default - test_00950 + system strings
@@ -153,7 +153,7 @@ 9000 default - test_00950 + system strings
@@ -184,7 +184,7 @@ 9000 default - test_00950 + system strings
diff --git a/dbms/tests/queries/0_stateless/00950_dict_get.sql b/dbms/tests/queries/0_stateless/00950_dict_get.sql index 2483a21c0d3..159f3eb0c4e 100644 --- a/dbms/tests/queries/0_stateless/00950_dict_get.sql +++ b/dbms/tests/queries/0_stateless/00950_dict_get.sql @@ -1,6 +1,5 @@ --- Must use `test_00950` database and these tables - they're configured in dbms/tests/*_dictionary.xml -create database if not exists test_00950; -use test_00950; +-- Must use `system` database and these tables - they're configured in dbms/tests/*_dictionary.xml +use system; drop table if exists ints; drop table if exists strings; drop table if exists decimals; @@ -270,7 +269,14 @@ select 'dictGetOrDefault', 'complex_cache_decimals' as dict_name, tuple(toUInt64 dictGetOrDefault(dict_name, 'd64', k, toDecimal64(42, 6)), dictGetOrDefault(dict_name, 'd128', k, toDecimal128(42, 1)); -drop table ints; -drop table strings; -drop table decimals; -drop database test_00950; +-- +-- Keep the tables, so that the dictionaries can be reloaded correctly and +-- SYSTEM RELOAD DICTIONARIES doesn't break. +-- We could also: +-- * drop the dictionaries -- not possible, they are configured in a .xml; +-- * switch dictionaries to DDL syntax so that they can be dropped -- tedious, +-- because there are a couple dozens of them, and also we need to have some +-- .xml dictionaries in tests so that we test backward compatibility with this +-- format; +-- * unload dictionaries -- no command for that. +--