Skip to content

Commit f497100

Browse files
authored
Merge pull request ClickHouse#79303 from ClickHouse/blacklist-update
Stateless tests: mark blacklisted tests as failed when they succeed
2 parents 5fed831 + 0218337 commit f497100

File tree

4 files changed

+36
-38
lines changed

4 files changed

+36
-38
lines changed

ci/jobs/scripts/functional_tests_results.py

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
# out = csv.writer(f, delimiter="\t")
2727
# out.writerow(status)
2828

29-
BROKEN_TESTS_ANALYZER_TECH_DEBT = [
30-
"01624_soft_constraints",
31-
]
32-
3329

3430
class FTResultsProcessor:
3531
@dataclasses.dataclass
@@ -50,7 +46,6 @@ def __init__(self, wd):
5046
self.tests_output_file = f"{wd}/test_result.txt"
5147
# self.test_results_parsed_file = f"{wd}/test_result.tsv"
5248
# self.status_file = f"{wd}/check_status.tsv"
53-
self.broken_tests = BROKEN_TESTS_ANALYZER_TECH_DEBT
5449

5550
def _process_test_output(self):
5651
total = 0
@@ -97,41 +92,20 @@ def _process_test_output(self):
9792

9893
total += 1
9994
if TIMEOUT_SIGN in line:
100-
if test_name in self.broken_tests:
101-
success += 1
102-
test_results.append((test_name, "BROKEN", test_time, []))
103-
else:
104-
failed += 1
105-
test_results.append((test_name, "Timeout", test_time, []))
95+
failed += 1
96+
test_results.append((test_name, "Timeout", test_time, []))
10697
elif FAIL_SIGN in line:
107-
if test_name in self.broken_tests:
108-
success += 1
109-
test_results.append((test_name, "BROKEN", test_time, []))
110-
else:
111-
failed += 1
112-
test_results.append((test_name, "FAIL", test_time, []))
98+
failed += 1
99+
test_results.append((test_name, "FAIL", test_time, []))
113100
elif UNKNOWN_SIGN in line:
114101
unknown += 1
115102
test_results.append((test_name, "FAIL", test_time, []))
116103
elif SKIPPED_SIGN in line:
117104
skipped += 1
118105
test_results.append((test_name, "SKIPPED", test_time, []))
119106
else:
120-
if OK_SIGN in line and test_name in self.broken_tests:
121-
skipped += 1
122-
test_results.append(
123-
(
124-
test_name,
125-
"NOT_FAILED",
126-
test_time,
127-
[
128-
"This test passed. Update analyzer_tech_debt.txt.\n"
129-
],
130-
)
131-
)
132-
else:
133-
success += int(OK_SIGN in line)
134-
test_results.append((test_name, "OK", test_time, []))
107+
success += int(OK_SIGN in line)
108+
test_results.append((test_name, "OK", test_time, []))
135109
test_end = False
136110
elif (
137111
len(test_results) > 0

tests/clickhouse-test

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,7 @@ class TestStatus(enum.Enum):
875875
UNKNOWN = "UNKNOWN"
876876
OK = "OK"
877877
SKIPPED = "SKIPPED"
878+
NOT_FAILED = "NOT_FAILED"
878879

879880

880881
class FailureReason(enum.Enum):
@@ -917,6 +918,10 @@ class FailureReason(enum.Enum):
917918
# UNKNOWN reasons
918919
NO_REFERENCE = "no reference file"
919920
INTERNAL_ERROR = "Test internal error: "
921+
NOT_FAILED = (
922+
"The test succeeded, but it is listed in parallel_replicas_blacklist.txt or async_insert_blacklist.txt. "
923+
"Please remove it from the list"
924+
)
920925

921926

922927
def threshold_generator(always_on_prob, always_off_prob, min_val, max_val):
@@ -1543,7 +1548,7 @@ class TestCase:
15431548

15441549
return None
15451550

1546-
def process_result_impl(self, proc, total_time: float):
1551+
def process_result_impl(self, proc, total_time: float) -> TestResult:
15471552
kill_output = ""
15481553
if proc:
15491554
if proc.returncode is None:
@@ -2050,6 +2055,13 @@ class TestCase:
20502055
if result.status == TestStatus.FAIL:
20512056
result.description = self.add_info_about_settings(result.description)
20522057

2058+
if self.name in suite.blacklist_check:
2059+
if result.status == TestStatus.OK:
2060+
result.status = TestStatus.NOT_FAILED
2061+
result.reason = FailureReason.NOT_FAILED
2062+
if result.status == TestStatus.FAIL:
2063+
result.status = TestStatus.SKIPPED
2064+
20532065
self._cleanup(result.status == TestStatus.OK)
20542066

20552067
return result
@@ -2328,6 +2340,10 @@ class TestSuite:
23282340
self.skip_list: List[str] = []
23292341
self.cloud_skip_list: List[str] = []
23302342
self.private_skip_list: List[str] = []
2343+
# List of tests included in a blacklist.
2344+
# They will be run, and if they succeed, the status will be changed to FAIL to notify
2345+
# that the changes in PR fixes this test.
2346+
self.blacklist_check: List[str] = []
23312347

23322348
if args.run_by_hash_num is not None and args.run_by_hash_total is not None:
23332349
if args.run_by_hash_num > args.run_by_hash_total:
@@ -2523,12 +2539,18 @@ def run_tests_array(
25232539
+ colored(" SKIPPED ", args, "cyan", attrs=["bold"])
25242540
+ CL_SQUARE_BRACKET
25252541
)
2542+
MSG_NOT_FAILED = (
2543+
OP_SQUARE_BRACKET
2544+
+ colored(" NOT_FAILED ", args, "red", attrs=["bold"])
2545+
+ CL_SQUARE_BRACKET
2546+
)
25262547

25272548
MESSAGES = {
25282549
TestStatus.FAIL: MSG_FAIL,
25292550
TestStatus.UNKNOWN: MSG_UNKNOWN,
25302551
TestStatus.OK: MSG_OK,
25312552
TestStatus.SKIPPED: MSG_SKIPPED,
2553+
TestStatus.NOT_FAILED: MSG_NOT_FAILED,
25322554
}
25332555

25342556
passed_total = 0
@@ -3294,12 +3316,13 @@ def main(args):
32943316
cloud_skip_list = try_get_skip_list(base_dir, "../queries-no-cloud-tests.txt")
32953317
private_skip_list = try_get_skip_list(base_dir, "../queries-no-private-tests.txt")
32963318
skip_list = []
3319+
blacklist_check = []
3320+
3321+
blacklist_check.extend(try_get_skip_list(base_dir, "../analyzer_tech_debt.txt"))
32973322

32983323
if args.no_parallel_replicas is True:
3299-
skip_list_parallel_replicas = try_get_skip_list(
3300-
base_dir, "../parallel_replicas_blacklist.txt"
3301-
)
3302-
skip_list.extend(skip_list_parallel_replicas)
3324+
blacklist = try_get_skip_list(base_dir, "../parallel_replicas_blacklist.txt")
3325+
blacklist_check.extend(blacklist)
33033326

33043327
for suite in sorted(os.listdir(base_dir), key=suite_key_func):
33053328
if server_died.is_set():
@@ -3312,6 +3335,7 @@ def main(args):
33123335
test_suite.skip_list = skip_list
33133336
test_suite.cloud_skip_list = cloud_skip_list
33143337
test_suite.private_skip_list = private_skip_list
3338+
test_suite.blacklist_check = blacklist_check
33153339
total_tests_run += do_run_tests(
33163340
args.jobs, test_suite, args, exit_code, restarted_tests, server_died
33173341
)

tests/parallel_replicas_blacklist.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@
513513

514514
00955_test_final_mark_use
515515
01624_soft_constraints
516-
02968_file_log_multiple_read
517516
03031_minmax_index_for_pointinpolygon
518517

519518
ORDER BY ALL is missing for multiple queries

tests/queries/0_stateless/02968_file_log_multiple_read.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env bash
2+
# Tags: no-parallel-replicas
23

34
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
45
# shellcheck source=../shell_config.sh

0 commit comments

Comments
 (0)