Skip to content

Commit

Permalink
sql/logictest: fix flaky test in unique
Browse files Browse the repository at this point in the history
This commit fixes a flaky test in the `unique` logic tests. The test
could flake because an `UPSERT` violated two unique constraints, making
the error message non-deterministic.

Fixes #95968

Release note: None
  • Loading branch information
mgartner committed Feb 7, 2023
1 parent 5b17995 commit 65569c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/sql/logictest/testdata/logic_test/unique
Original file line number Diff line number Diff line change
Expand Up @@ -829,10 +829,10 @@ statement error pgcode 23505 pq: duplicate key value violates unique constraint
INSERT INTO uniq_computed_pk (i, s, d) VALUES (1, 'a', 1.0) ON CONFLICT (s) DO UPDATE SET i = 2

statement error pgcode 23505 pq: duplicate key value violates unique constraint "uniq_computed_pk_c_s_s_key"\nDETAIL: Key \(c_s,s\)=\('b','b'\) already exists\.
UPSERT INTO uniq_computed_pk (i, s, d) VALUES (1, 'b', 1.0)
UPSERT INTO uniq_computed_pk (i, s, d) VALUES (3, 'b', 3.0)

statement error pgcode 23505 pq: duplicate key value violates unique constraint "unique_d"\nDETAIL: Key \(d\)=\(2\.00\) already exists\.
UPSERT INTO uniq_computed_pk (i, s, d) VALUES (1, 'a', 2.00)
UPSERT INTO uniq_computed_pk (i, s, d) VALUES (3, 'c', 2.00)

query ITFTTFT colnames,rowsort
SELECT * FROM uniq_computed_pk
Expand Down

0 comments on commit 65569c6

Please sign in to comment.