Skip to content

Commit df9bf8a

Browse files
craig[bot]yuzefovichrytaft
committed
145208: exec/explain: bump test timeout to 5 minutes r=yuzefovich a=yuzefovich We recently added TestMaximumMemoryUsage that is pretty heavy and just saw the package time out with 1 minute, so let's bump the size to 5 minutes. Fixes: #145027. Release note: None 145222: sql: add some additional testing in mixed_version_bundle r=rytaft a=rytaft This is a test-only change to add some additional testing for the version gate for the new column in `system.statement_diagnostics_requests`. Informs #143484 Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]> Co-authored-by: Rebecca Taft <[email protected]>
3 parents 650eac4 + 435864d + f16740d commit df9bf8a

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed

pkg/sql/logictest/testdata/logic_test/mixed_version_bundle

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ SELECT pg_sleep(1);
4242
statement ok
4343
EXPLAIN ANALYZE (DEBUG) SELECT * FROM t;
4444

45+
statement ok
46+
SELECT crdb_internal.request_statement_bundle('SELECT _, _, _ FROM _', 0::FLOAT, 0::INTERVAL, 0::INTERVAL);
47+
4548
upgrade 0
4649

4750
statement ok
@@ -50,10 +53,60 @@ SELECT pg_sleep(1);
5053
statement ok
5154
EXPLAIN ANALYZE (DEBUG) SELECT * FROM t;
5255

56+
statement ok
57+
GRANT SYSTEM VIEWACTIVITY TO testuser;
58+
GRANT SELECT ON t TO testuser;
59+
60+
user testuser
61+
62+
# Request a statement bundle as testuser. The user won't be captured since
63+
# the cluster setting is not yet active.
64+
statement ok
65+
SELECT crdb_internal.request_statement_bundle('SELECT _, _, _, _ FROM _', 0::FLOAT, 0::INTERVAL, 0::INTERVAL);
66+
67+
user root
68+
5369
upgrade 2
5470

71+
# Block until upgrade is complete.
72+
statement ok
73+
SET CLUSTER SETTING version = crdb_internal.node_executable_version();
74+
75+
query B retry
76+
SELECT crdb_internal.is_at_least_version('25.1-08')
77+
----
78+
true
79+
5580
statement ok
5681
SELECT pg_sleep(1);
5782

83+
user testuser
84+
85+
# Request a statement bundle as testuser. Since it's an explicit
86+
# EXPLAIN ANALYZE (DEBUG) invocation, we don't store the username in
87+
# system.statement_diagnostics_requests.
5888
statement ok
5989
EXPLAIN ANALYZE (DEBUG) SELECT * FROM t;
90+
91+
# Request a statement bundle as testuser. The user should be captured since
92+
# the cluster setting is now active.
93+
statement ok
94+
SELECT crdb_internal.request_statement_bundle('SELECT _, _, _, _, _ FROM _', 0::FLOAT, 0::INTERVAL, 0::INTERVAL);
95+
96+
user root
97+
98+
# Currently the user is not set for requests added with EXPLAIN ANALYZE (DEBUG).
99+
# For other requests, the user is only set once the cluster setting is active,
100+
# in this case for the final invocation of crdb_internal.request_statement_bundle.
101+
query TT
102+
SELECT statement_fingerprint, username FROM system.statement_diagnostics_requests
103+
ORDER BY statement_fingerprint;
104+
----
105+
EXPLAIN ANALYZE (DEBUG) SELECT * FROM t ·
106+
EXPLAIN ANALYZE (DEBUG) SELECT * FROM t ·
107+
EXPLAIN ANALYZE (DEBUG) SELECT * FROM t ·
108+
EXPLAIN ANALYZE (DEBUG) SELECT * FROM t ·
109+
SELECT _, _ FROM _ ·
110+
SELECT _, _, _ FROM _ ·
111+
SELECT _, _, _, _ FROM _ ·
112+
SELECT _, _, _, _, _ FROM _ testuser

pkg/sql/opt/exec/explain/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ go_library(
5252

5353
go_test(
5454
name = "explain_test",
55-
size = "small",
55+
size = "medium",
5656
srcs = [
5757
"explain_factory_test.go",
5858
"main_test.go",

0 commit comments

Comments
 (0)