Skip to content

Commit e9631b4

Browse files
craig[bot]fqazi
andcommitted
Merge #148824
148824: logictest: deflake drop_database r=fqazi a=fqazi Previously, the drop_database logic test would list SCHEMA CHANGE GC and SCHEMA CHANGE jobs without filtering the job description and a limit clause, which would be non-deterministic. To address this, this patch adds filtering on job description and removes the limit clause for a more deterministic result. Fixes: #148009 Release note: None Co-authored-by: Faizan Qazi <[email protected]>
2 parents 3145ed0 + d4511c6 commit e9631b4

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

pkg/sql/logictest/testdata/logic_test/drop_database

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,21 @@ query TT
226226
WITH cte AS (
227227
SELECT job_type, description
228228
FROM crdb_internal.jobs
229-
WHERE (job_type = 'SCHEMA CHANGE' OR job_type = 'SCHEMA CHANGE GC')
229+
WHERE (job_type = 'NEW SCHEMA CHANGE' OR job_type = 'SCHEMA CHANGE GC')
230230
AND (status = 'succeeded' OR status = 'running')
231+
AND (description LIKE '%DROP%')
231232
ORDER BY created DESC
232-
LIMIT 4
233233
) SELECT * FROM cte ORDER BY job_type, description
234234
----
235-
SCHEMA CHANGE CREATE TABLE constraint_db.public.t2 (t1_id INT8, CONSTRAINT fk FOREIGN KEY (t1_id) REFERENCES constraint_db.public.t1 (a), INDEX (t1_id))
236-
SCHEMA CHANGE updating referenced FK table t1(125) for table t2(126)
237-
SCHEMA CHANGE GC GC for DROP DATABASE constraint_db CASCADE
238-
SCHEMA CHANGE GC GC for DROP DATABASE d2 CASCADE
235+
NEW SCHEMA CHANGE DROP DATABASE "foo bar" CASCADE
236+
NEW SCHEMA CHANGE DROP DATABASE "foo-bar" CASCADE
237+
NEW SCHEMA CHANGE DROP DATABASE constraint_db CASCADE
238+
NEW SCHEMA CHANGE DROP DATABASE d1 CASCADE
239+
NEW SCHEMA CHANGE DROP DATABASE d2 CASCADE
240+
SCHEMA CHANGE GC GC for DROP DATABASE "foo-bar" CASCADE
241+
SCHEMA CHANGE GC GC for DROP DATABASE constraint_db CASCADE
242+
SCHEMA CHANGE GC GC for DROP DATABASE d1 CASCADE
243+
SCHEMA CHANGE GC GC for DROP DATABASE d2 CASCADE
239244

240245
query TTTTTT rowsort
241246
SHOW DATABASES

0 commit comments

Comments
 (0)