Re: Add isolation test template in injection_points for wait/wakeup/detach
Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-02-05T11:03:25Z
Lists: pgsql-hackers
Hi, On Wed, Feb 05, 2025 at 03:12:53PM +0900, Michael Paquier wrote: > On Thu, Oct 31, 2024 at 08:47:04AM +0900, Michael Paquier wrote: > > Thanks for the review. Applied that, then. > > I was looking at src/test/isolation/README, and based on what is > described for parenthesized markers (which I didn't know about so we > learn a new thing every day), it is possible to force a strict > ordering of the test. Quote that matters: > "A marker consisting solely of a step name indicates that this step > may not be reported as completing until that other step has > completed." Oh, I did not know about it too (thanks for sharing). > In our case, the problem that caused 9f00edc22888 is that the "wait" > step could be so slow that the "detach" step could report before the > "wait" step. Yup. > So I'd like to propose that we revisit 9f00edc22888, and re-enable the > permutation with a marker so as the "detach" step waits for the "wait" > step to complete before printing its own report, as per the attached. > That should make the permutation safe to use. > > The output of the attached patch is the same as what has been removed > in 9f00edc22888 except that the permutation is changed from that: > permutation wait1 wakeup2 detach2 > To that, making sure that detach2 report happens only after wait1 > has returned its own result: > permutation wait1 wakeup2 detach2(wait1) > > Thoughts? I think that makes sense and the patch LGTM. A few tests are already using this technique (including injection_points in inplace.spec). Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
Commits
-
injection_points: Tweak more permutation in isolation test "basic"
- 926c7fce0360 18.0 landed
-
injection_points: Re-enable permutation in isolation test "basic"
- 9e020050b8fa 18.0 landed
-
injection_points: Improve comment about disabled isolation permutation
- baa1ae04299f 18.0 landed
-
injection_points: Disable one permutation in isolation test "basic"
- 9f00edc22888 18.0 landed
-
injection_points: Add basic isolation test
- a7800cf498a3 18.0 landed