Skip to content

Commit

Permalink
logictest: fix flakey alter_table
Browse files Browse the repository at this point in the history
The GC job for the temp index runs immediately so the fraction might be 1.

Fixes cockroachdb#76911.

Release justification: non-production code change

Release note: None
  • Loading branch information
ajwerner authored and RajivTS committed Mar 6, 2022
1 parent b61d605 commit 9da86df
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/sql/logictest/testdata/logic_test/alter_table
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,16 @@ ALTER TABLE t ADD CONSTRAINT dne_unique UNIQUE (dne)
# We ignore the job status because GC for temporary indexes used
# during backfills may already running rather than waiting for the GC
# TTL depending on the timing.
query TTTR
SELECT job_type, regexp_replace(description, 'JOB \d+', 'JOB ...'), user_name, fraction_completed::decimal(10,2)
query TTT
SELECT job_type, regexp_replace(description, 'JOB \d+', 'JOB ...'), user_name
FROM crdb_internal.jobs
WHERE job_type = 'SCHEMA CHANGE' OR job_type = 'SCHEMA CHANGE GC'
ORDER BY created DESC
LIMIT 3
----
SCHEMA CHANGE GC GC for temporary index used during index backfill root 0.00
SCHEMA CHANGE GC GC for ROLLBACK of ALTER TABLE test.public.t ADD CONSTRAINT bar UNIQUE (c) root 0.00
SCHEMA CHANGE ALTER TABLE test.public.t ADD CONSTRAINT bar UNIQUE (c) root 0.00
SCHEMA CHANGE GC GC for temporary index used during index backfill root
SCHEMA CHANGE GC GC for ROLLBACK of ALTER TABLE test.public.t ADD CONSTRAINT bar UNIQUE (c) root
SCHEMA CHANGE ALTER TABLE test.public.t ADD CONSTRAINT bar UNIQUE (c) root

query IIII colnames,rowsort
SELECT * FROM t
Expand Down

0 comments on commit 9da86df

Please sign in to comment.