@@ -52,9 +52,18 @@ def tpc_test(suite_name: Literal["h", "ds"], *, result_is_empty=False):
52
52
def inner (test : Callable [..., ir .Table ]):
53
53
name = f"tpc{ suite_name } "
54
54
55
- @getattr (pytest .mark , name )
55
+ # so that clickhouse doesn't run forever when we hit one of its weird cross
56
+ # join performance black holes
57
+ #
58
+ # trino can sometimes take a while as well, especially in CI
59
+ #
60
+ # func_only=True doesn't include the fixture setup time in the duration
61
+ # of the test run, which is important since backends can take a hugely
62
+ # variable amount of time to load all the TPC-$WHATEVER tables.
63
+ @pytest .mark .timeout (60 , func_only = True )
56
64
@pytest .mark .usefixtures ("backend" )
57
65
@pytest .mark .xdist_group (name )
66
+ @getattr (pytest .mark , name )
58
67
@functools .wraps (test )
59
68
def wrapper (* args , backend , ** kwargs ):
60
69
backend_name = backend .name ()
@@ -94,17 +103,25 @@ def wrapper(*args, backend, **kwargs):
94
103
95
104
assert result_expr ._find_backend (use_default = False ) is backend .connection
96
105
result = backend .connection .to_pandas (result_expr )
97
- assert (result_is_empty and result .empty ) or not result .empty
106
+
107
+ assert (result_is_empty and result .empty ) or (
108
+ not result_is_empty and not result .empty
109
+ )
98
110
99
111
expected = expected_expr .to_pandas ()
100
112
101
113
assert len (expected .columns ) == len (result .columns )
102
- assert all (r in e .lower () for r , e in zip (result .columns , expected .columns ))
114
+ assert all (
115
+ r .lower () in e .lower () for r , e in zip (result .columns , expected .columns )
116
+ )
103
117
104
118
expected .columns = result .columns
105
119
106
120
expected = PandasData .convert_table (expected , result_expr .schema ())
107
- assert (result_is_empty and expected .empty ) or not expected .empty
121
+
122
+ assert (result_is_empty and expected .empty ) or (
123
+ not result_is_empty and not expected .empty
124
+ )
108
125
109
126
assert len (expected ) == len (result )
110
127
assert result .columns .tolist () == expected .columns .tolist ()
0 commit comments