forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite208026
committed
Fix race condition in TAP test 007_pre_auth
The authentication test added inc76db55 expects a backend to startand wait at the injection point "init-pre-auth". A query is used toretrieve the PID of the backend waiting at authentication, but its WHEREclause was too soft, checking only for a backend in a "starting" state.As proved by the CI, this WHERE clause is not enough. There is a smallwindow between the moment when the backend is reported as "starting" inits backend entry and the moment when it waits in its injection point,and it was possible for the test to return the PID of a backend processnot yet waiting in the injection point, causing spurious failures. Thisissue is fixed by tweaking the query retrieving the PID of the backendwaiting before authentication so as we check for "init-pre-auth" in itswait_event. An extra check based on the backend_type is added, based ona suggestion by Jacob, to be more cautious.Error spotted by the CI on Windows, but it could happen anywhere, aslong as the authentication path is slow enough compared to the TAP test.Reported-by: Andres Freund <andres@anarazel.de>Author: Jacob Champion <jacob.champion@enterprisedb.com>Co-authored-by: Michael Paquier <michael@paquier.xyz>Discussion:https://postgr.es/m/soexrl7oeyku24bj3czupxmv27ow35u6edymp5y3oyoysbe2kb@r3tgoos2xp2x1 parent24503fa commite208026
1 file changed
+6
-2
lines changedLines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
46 |
| - | |
| 46 | + | |
| 47 | + | |
47 | 48 |
| |
48 | 49 |
| |
49 | 50 |
| |
50 | 51 |
| |
51 |
| - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
52 | 56 |
| |
53 | 57 |
| |
54 | 58 |
| |
|
0 commit comments
Comments
(0)