Repository navigation
Commit 6bb2a54
committed
fix: slice 040 AC3 measures the watcher, not the machine
The skills AC3 test was red on one machine and green on CI, and the reason was
different in each place. Neither was the watcher misbehaving.
On CI there is no inotifywait, so the registry takes the fs_poll backend: a poll
every second over mtimes at one-second resolution, whose worst case is about two
seconds. AC3's bound is two seconds. There was no margin at all, and a loaded
shared runner closed it. Measured here, with the backend forced:
interval 1000 ms (shipped) 1222 ms, 1223 ms
interval 100 ms (suite) 339 ms, 312 ms, 338 ms
The interval is now configurable and the suite sets 100 ms. The shipped default is
unchanged: a desktop does not need a tenth-of-a-second poll, and the criterion it
has to meet is the same either way.
The suite also pins the backend. Which one the registry picks otherwise depends on
the machine, so the test measured a different mechanism in each place. Worse, on a
box already at its inotify instance ceiling (128 here, 119 in use) the native
backend obtains no watch and fails silently: the test then fails for a reason that
has nothing to do with the product, and the old assertion could only report it as
AC3: the edit was in the registry after ms
because the poll window and the criterion were the same 2000 ms budget and an
exhausted loop was indistinguishable from a late arrival. They are separate now.
The loop waits 15 s so a failure says which of the two happened, and the criterion
is asserted against the latency actually measured.
Verified on the machine where it was failing: three runs, 338, 338 and 312 ms, and
a full gate at 951 passed.
R26 inside the sandbox, which is the other test
Gateways.IdentitiesTest fails on CI with Database busy on an insert, and
config/test.exs sets default_transaction_mode: :immediate on both test repos,
which reads as though slice 005 had covered the suite. It has not.
Ecto.Adapters.SQL.Sandbox.post_checkout/3 begins each test's transaction with
handle_begin([mode: :transaction] ++ opts, ...), and Exqlite.Connection resolves
the mode as Keyword.get(options, :mode, state.default_transaction_mode), so the
explicit option wins over the configuration and :transaction is a plain DEFERRED
BEGIN. Every sandboxed test is a DEFERRED transaction, and one that reads before it
writes is on R26's unguarded upgrade path, where no busy_timeout applies.
Identities.admit/3 reads and then inserts, with no transaction of its own.
That is diagnosis, not a fix, and it is recorded as such: the comment in
config/test.exs no longer implies the suite is covered, and
test/trinity/repo/sandbox_transaction_mode_test.exs asserts both dependency lines
so the paragraph fails rather than rots if an upgrade moves them. The identities
test is not changed, because the concurrent writer that completes the mechanism is
still unidentified and the failure does not reproduce here.
Signed-off-by: Ayla Croft <aylacroft@proton.me>1 parent dc8d459 commit 6bb2a54
4 files changed
Lines changed: 135 additions & 11 deletions
File tree
- config
- lib/trinity/skills
- test/trinity
- repo
- skills
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
177 | 188 | | |
178 | 189 | | |
179 | 190 | | |
| |||
260 | 271 | | |
261 | 272 | | |
262 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
263 | 286 | | |
264 | 287 | | |
265 | 288 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
307 | 314 | | |
308 | | - | |
| 315 | + | |
309 | 316 | | |
310 | 317 | | |
311 | 318 | | |
312 | 319 | | |
313 | 320 | | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
314 | 331 | | |
315 | 332 | | |
316 | 333 | | |
| |||
327 | 344 | | |
328 | 345 | | |
329 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
330 | 350 | | |
331 | 351 | | |
332 | 352 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
149 | 162 | | |
150 | 163 | | |
0 commit comments