forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit320c311
committed
worker_spi: Switch to TAP tests
This commit moves worker_spi to use TAP tests. sql/worker_spi.sql isgone, replaced by an equivalent set of queries in a TAP script, withoutworker_spi loaded in shared_preload_libraries:- One query to launch a worker dynamically, relying now on "postgres" asthe default database to connect to.- Two wait queries with poll_query_until(), one to wait for the workerschema to be initialized and a second to wait for a tuple processed bythe worker.- Server reload to accelerate the main loop of the spawned worker.More coverage is added for workers registered when the library is loadedwith shared_preload_libraries, while on it, checking that these areconnecting to the database set in the GUC worker_spi.database.A local run of these test is showing that TAP is slightly faster thanthe original, while providing more coverage (3.7s vs 4.4s). There wasalso some discussions about keeping the SQL tests, but this wouldrequire initializing twice a cluster, increasing the runtime of thetests up to 5.6s here.These tests will be expanded more in an upcoming patch aimed at addingsupport for custom wait events for the Extension class, still underdiscussion, to check the new in-core APIs with and without a library setin shared_preload_libraries.Bharath has written the part where shared_preload_libraries is used,while I have migrated the existing SQL tests to TAP.Author: Bharath Rupireddy, Michael PaquierReviewed-by: Masahiro IkedaDiscussion:https://postgr.es/m/CALj2ACWR9ncAiDF73unqdJF1dmsA2R0efGXX2624X+YVxcAVWg@mail.gmail.com1 parentb635ac0 commit320c311
File tree
7 files changed
+84
-102
lines changed- src/test/modules/worker_spi
- expected
- sql
- t
7 files changed
+84
-102
lines changedLines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
3 |
| - | |
4 | 2 |
|
Lines changed: 1 addition & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
10 |
| - | |
11 |
| - | |
12 |
| - | |
13 |
| - | |
14 |
| - | |
15 |
| - | |
| 9 | + | |
16 | 10 |
| |
17 | 11 |
| |
18 | 12 |
| |
|
Lines changed: 0 additions & 2 deletions
This file was deleted.
Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 3 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 |
| - | |
29 |
| - | |
30 |
| - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 |
| |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 | 32 |
| |
36 | 33 |
|
Lines changed: 0 additions & 35 deletions
This file was deleted.
Lines changed: 80 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + |
0 commit comments
Comments
(0)