Repository navigation
Commit 0089fb1
committed
test(host-kit): one double answers every group write in these tests
`guardGroupWrites` had been introduced as the seam every group write is answered at, and then two tests
beside it went on answering the same question with hand-written `vi.spyOn(process, 'kill')` doubles. Two
doubles for one seam is a slow disagreement waiting to happen: the spy said delivery and the guard said
delivery differently, and only one of them was checked against what `process.kill` really answers.
Both are built on the guard now, and the three answers it can give — `true` for a delivered write,
`ESRCH`, `EPERM` — are one table with the report each must produce, so the delivered case and the two
refusals cannot drift apart or be edited separately. The invalid-pid checks moved into the same shape
rather than staying beside it, and their proof got stronger: the guard records every write it is asked
about, so "nothing was signalled" is now an empty list rather than a spy call count, which is a claim
about what the seam did rather than about how the spy was wired. The comment clause claiming only one
of the three answers was tested is gone, since it was written before the third arrived.
Mutations, one at a time: making the catch in `signalProcessGroupBestEffort` rethrow `EPERM` reddens the
table test and nothing else; replacing its pid refusal with a NaN check reddens the invalid-pid test
through that empty list. Running the second is safe precisely because the guard answers a negative pid
itself and never forwards one to the kernel.1 parent 725a225 commit 0089fb1
1 file changed
Lines changed: 28 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
214 | 222 | | |
215 | 223 | | |
216 | 224 | | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
224 | 229 | | |
225 | | - | |
226 | 230 | | |
227 | 231 | | |
228 | | - | |
229 | | - | |
230 | | - | |
| 232 | + | |
| 233 | + | |
231 | 234 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 235 | + | |
249 | 236 | | |
250 | 237 | | |
251 | 238 | | |
| |||
0 commit comments