From 8a807c01f69ff66171d74d7dc05a952040f7f591 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Fri, 11 Aug 2023 17:07:38 -0700 Subject: [PATCH] Test fallback path for duplicates [skip ci] --- test/t/015_hnsw_duplicates.pl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/test/t/015_hnsw_duplicates.pl b/test/t/015_hnsw_duplicates.pl index 5a2b9d1..dcf319e 100644 --- a/test/t/015_hnsw_duplicates.pl +++ b/test/t/015_hnsw_duplicates.pl @@ -16,7 +16,7 @@ $node->safe_psql("postgres", "CREATE TABLE tst (v vector(3));"); sub insert_vectors { for my $i (1 .. 20) { - $node->safe_psql("postgres", "INSERT INTO tst VALUES ('[1,1,1]')"); + $node->safe_psql("postgres", "INSERT INTO tst VALUES ('[1,1,1]');"); } } @@ -42,4 +42,16 @@ $node->safe_psql("postgres", "TRUNCATE tst;"); insert_vectors(); test_duplicates(); +# Test fallback path +$node->pgbench( + "--no-vacuum --client=5 --transactions=100", + 0, + [qr{actually processed}], + [qr{^$}], + "concurrent INSERTs", + { + "015_hnsw_duplicates" => "INSERT INTO tst VALUES ('[1,1,1]');" + } +); + done_testing();