Weird test mixup

Heikki Linnakangas <hlinnaka@iki.fi>

From: Heikki Linnakangas <hlinnaka@iki.fi>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2024-03-14T21:23:46Z
Lists: pgsql-hackers
I got a weird test failure while testing my forking refactor patches on 
Cirrus CI 
(https://cirrus-ci.com/task/5880724448870400?logs=test_running#L121):

> [16:52:39.753] Summary of Failures:
> [16:52:39.753] 
> [16:52:39.753] 66/73 postgresql:intarray-running / intarray-running/regress                       ERROR             6.27s   exit status 1
> [16:52:39.753] 
> [16:52:39.753] Ok:                 72  
> [16:52:39.753] Expected Fail:      0   
> [16:52:39.753] Fail:               1   
> [16:52:39.753] Unexpected Pass:    0   
> [16:52:39.753] Skipped:            0   
> [16:52:39.753] Timeout:            0   
> [16:52:39.753] 
> [16:52:39.753] Full log written to /tmp/cirrus-ci-build/build/meson-logs/testlog-running.txt

And:

> diff -U3 /tmp/cirrus-ci-build/contrib/intarray/expected/_int.out /tmp/cirrus-ci-build/build/testrun/intarray-running/regress/results/_int.out
> --- /tmp/cirrus-ci-build/contrib/intarray/expected/_int.out	2024-03-14 16:48:48.690367000 +0000
> +++ /tmp/cirrus-ci-build/build/testrun/intarray-running/regress/results/_int.out	2024-03-14 16:52:05.759444000 +0000
> @@ -804,6 +804,7 @@
>  
>  DROP INDEX text_idx;
>  CREATE INDEX text_idx on test__int using gin ( a gin__int_ops );
> +ERROR:  error triggered for injection point gin-leave-leaf-split-incomplete
>  SELECT count(*) from test__int WHERE a && '{23,50}';
>   count 
>  -------
> @@ -877,6 +878,7 @@
>  (1 row)
>  
>  DROP INDEX text_idx;
> +ERROR:  index "text_idx" does not exist
>  -- Repeat the same queries with an extended data set. The data set is the
>  -- same that we used before, except that each element in the array is
>  -- repeated three times, offset by 1000 and 2000. For example, {1, 5}

Somehow the 'gin-leave-leaf-split-incomplete' injection point was active 
in the 'intarray' test. That makes no sense. That injection point is 
only used by the test in src/test/modules/gin/. Perhaps that ran at the 
same time as the intarray test? But they run in separate instances, with 
different data directories. And the 'gin' test passed.

I'm completely stumped. Anyone have a theory?

-- 
Heikki Linnakangas
Neon (https://neon.tech)



Commits

  1. injection_points: Store runtime conditions in private area

  2. Introduce private data area for injection points

  3. injection_points: Fix incorrect spinlock acquisition

  4. Make GIN tests using injection points concurrent-safe

  5. injection_points: Fix race condition with local injection point tests

  6. injection_points: Introduce runtime conditions

  7. Make GIN test using injection points repeatable

  8. Fix backstop in gin test if injection point is not reached

  9. Try to unbreak injection-fault tests in the buildfarm

  10. Disable tests using injection points in installcheck