Repository navigation
Commit e61054a
committed
Synchronise 039 on sync_event instead of fixed sleeps
Two sleep(2) calls stood in for synchronisation. The first waited for
the apply worker to pick up a reloaded spock.exception_behaviour, the
second for it to go idle before the cancel. Neither was guaranteed:
the row arriving proves the commit is visible, but handle_commit() then
calls process_syncing_tables(), which opens a transaction of its own, so
the cancel could land outside the window the test is about and the test
would pass without exercising the leak.
Use spock.sync_event() and wait_for_sync_event() instead. A
non-transactional sync event is decoded outside any remote transaction
and ordered after the preceding commit, so the origin reaching its LSN
means handle_commit() ran to the end -- replay queue reset, use_try_block
cleared. It also orders the reload, since the worker tests
ConfigReloadPending before reading from the stream.
The same call replaces wait_for_row(), a 90s polling loop that burned its
full timeout on failure; a plain SELECT after the sync does the job.
Renumbered from 037, which PR #545 also claims, and added to
tests/tap/schedule -- CI runs run_tests.sh, which is schedule-driven, so
the test would never have been executed.
29 subtests to 33, passing, ~26s.1 parent 2887651 commit e61054a
2 files changed
Lines changed: 24 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | 112 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | | - | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
124 | 132 | | |
125 | 133 | | |
126 | 134 | | |
127 | 135 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | 136 | | |
132 | 137 | | |
133 | 138 | | |
| |||
144 | 149 | | |
145 | 150 | | |
146 | 151 | | |
147 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
148 | 156 | | |
149 | 157 | | |
150 | 158 | | |
| |||
0 commit comments