Show More
@@ -3,6 +3,7 Check potential race conditions between | |||
|
3 | 3 | ============================================================================== |
|
4 | 4 | |
|
5 | 5 | #testcases dirstate-v1 dirstate-v2-append dirstate-v2-rewrite |
|
6 | #testcases pre-all-read pre-some-read | |
|
6 | 7 | |
|
7 | 8 | Some commands, like `hg status`, do not need to take the wlock but need to |
|
8 | 9 | access dirstate data. |
@@ -46,6 +47,17 Setup | |||
|
46 | 47 | $ d2args="--config devel.dirstate.v2.data_update_mode=force-append" |
|
47 | 48 | #endif |
|
48 | 49 | |
|
50 | ||
|
51 | #if dirstate-v1 | |
|
52 | $ cfg="devel.sync.dirstate.pre-read-file" | |
|
53 | #else | |
|
54 | #if pre-all-read | |
|
55 | $ cfg="devel.sync.dirstate.pre-read-file" | |
|
56 | #else | |
|
57 | $ cfg="devel.sync.dirstate.post-docket-read-file" | |
|
58 | #endif | |
|
59 | #endif | |
|
60 | ||
|
49 | 61 | $ directories="dir dir/nested dir2" |
|
50 | 62 | $ first_files="dir/nested/a dir/b dir/c dir/d dir2/e f" |
|
51 | 63 | $ second_files="g dir/nested/h dir/i dir/j dir2/k dir2/l dir/nested/m" |
@@ -134,7 +146,7 spin a `hg status` with some caches to u | |||
|
134 | 146 | |
|
135 | 147 | $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
|
136 | 148 | > --config rhg.on-unsupported=abort \ |
|
137 |
> --config |
|
|
149 | > --config ${cfg}=$TESTTMP/status-race-lock \ | |
|
138 | 150 | > & |
|
139 | 151 | $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
|
140 | 152 | |
@@ -165,6 +177,7 The status process should return a consi | |||
|
165 | 177 | $ cat $TESTTMP/status-race-lock.log |
|
166 | 178 | #else |
|
167 | 179 | #if rhg |
|
180 | #if pre-all-read | |
|
168 | 181 | $ cat $TESTTMP/status-race-lock.out |
|
169 | 182 | A dir/n |
|
170 | 183 | A dir/o |
@@ -173,12 +186,34 The status process should return a consi | |||
|
173 | 186 | ? q |
|
174 | 187 | $ cat $TESTTMP/status-race-lock.log |
|
175 | 188 | #else |
|
189 | #if dirstate-v2-append | |
|
190 | $ cat $TESTTMP/status-race-lock.out | |
|
191 | A dir/o | |
|
192 | R dir/nested/m | |
|
193 | ? dir/n | |
|
194 | ? p | |
|
195 | ? q | |
|
196 | $ cat $TESTTMP/status-race-lock.log | |
|
197 | #else | |
|
198 | $ cat $TESTTMP/status-race-lock.out | |
|
199 | $ cat $TESTTMP/status-race-lock.log | |
|
200 | abort: dirstate-v2 parse error: not enough bytes on disk | |
|
201 | #endif | |
|
202 | #endif | |
|
203 | #else | |
|
176 | 204 | #if rust |
|
177 | 205 | #if dirstate-v2-rewrite |
|
178 | 206 | $ cat $TESTTMP/status-race-lock.out |
|
179 | 207 | $ cat $TESTTMP/status-race-lock.log |
|
180 | 208 | abort: $ENOENT$: '$TESTTMP/race-with-add/.hg/dirstate.* (glob) |
|
181 | 209 | #else |
|
210 | $ cat $TESTTMP/status-race-lock.out | |
|
211 | A dir/o | |
|
212 | R dir/nested/m | |
|
213 | ? dir/n | |
|
214 | ? p | |
|
215 | ? q | |
|
216 | $ cat $TESTTMP/status-race-lock.log | |
|
182 | 217 | #endif |
|
183 | 218 | #else |
|
184 | 219 | $ cat $TESTTMP/status-race-lock.out |
@@ -203,7 +238,7 spin a `hg status with some cache to upd | |||
|
203 | 238 | |
|
204 | 239 | $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
|
205 | 240 | > --config rhg.on-unsupported=abort \ |
|
206 |
> --config |
|
|
241 | > --config ${cfg}=$TESTTMP/status-race-lock \ | |
|
207 | 242 | > & |
|
208 | 243 | $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
|
209 | 244 | |
@@ -245,18 +280,41 The status process should return a consi | |||
|
245 | 280 | warning: ignoring unknown working parent 02a67a77ee9b! (no-rhg !) |
|
246 | 281 | #else |
|
247 | 282 | #if rhg |
|
283 | #if pre-all-read | |
|
248 | 284 | $ cat $TESTTMP/status-race-lock.out |
|
249 | 285 | ? dir/n |
|
250 | 286 | ? p |
|
251 | 287 | ? q |
|
252 | 288 | $ cat $TESTTMP/status-race-lock.log |
|
253 | 289 | #else |
|
290 | #if dirstate-v2-append | |
|
291 | $ cat $TESTTMP/status-race-lock.out | |
|
292 | A dir/o | |
|
293 | R dir/nested/m | |
|
294 | ? dir/n | |
|
295 | ? p | |
|
296 | ? q | |
|
297 | $ cat $TESTTMP/status-race-lock.log | |
|
298 | #else | |
|
299 | $ cat $TESTTMP/status-race-lock.out | |
|
300 | $ cat $TESTTMP/status-race-lock.log | |
|
301 | abort: dirstate-v2 parse error: not enough bytes on disk | |
|
302 | #endif | |
|
303 | #endif | |
|
304 | #else | |
|
254 | 305 | #if rust |
|
255 | 306 | #if dirstate-v2-rewrite |
|
256 | 307 | $ cat $TESTTMP/status-race-lock.out |
|
257 | 308 | $ cat $TESTTMP/status-race-lock.log |
|
258 | 309 | abort: $ENOENT$: '$TESTTMP/race-with-commit/.hg/dirstate.* (glob) |
|
259 | 310 | #else |
|
311 | $ cat $TESTTMP/status-race-lock.out | |
|
312 | A dir/o | |
|
313 | R dir/nested/m | |
|
314 | ? dir/n | |
|
315 | ? p | |
|
316 | ? q | |
|
317 | $ cat $TESTTMP/status-race-lock.log | |
|
260 | 318 | #endif |
|
261 | 319 | #else |
|
262 | 320 | $ cat $TESTTMP/status-race-lock.out |
@@ -281,7 +339,7 spin a `hg status` with some caches to u | |||
|
281 | 339 | |
|
282 | 340 | $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
|
283 | 341 | > --config rhg.on-unsupported=abort \ |
|
284 |
> --config |
|
|
342 | > --config ${cfg}=$TESTTMP/status-race-lock \ | |
|
285 | 343 | > & |
|
286 | 344 | $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
|
287 | 345 | do an update |
@@ -301,6 +359,25 do an update | |||
|
301 | 359 | 0 files updated, 0 files merged, 6 files removed, 0 files unresolved |
|
302 | 360 | $ touch $TESTTMP/status-race-lock |
|
303 | 361 | $ wait |
|
362 | #if rhg dirstate-v2-append pre-some-read | |
|
363 | $ hg log -GT '{node|short} {desc}\n' | |
|
364 | @ 9a86dcbfb938 more files to have two commit | |
|
365 | | | |
|
366 | o 4f23db756b09 recreate a bunch of files to facilitate dirstate-v2 append | |
|
367 | ||
|
368 | $ hg status | |
|
369 | A dir/o | |
|
370 | R dir/nested/m | |
|
371 | ! dir/i | |
|
372 | ! dir/j | |
|
373 | ! dir/nested/h | |
|
374 | ! dir2/k | |
|
375 | ! dir2/l | |
|
376 | ! g | |
|
377 | ? dir/n | |
|
378 | ? p | |
|
379 | ? q | |
|
380 | #else | |
|
304 | 381 |
$ |
|
305 | 382 | o 9a86dcbfb938 more files to have two commit |
|
306 | 383 | | |
@@ -311,6 +388,7 do an update | |||
|
311 | 388 | ? dir/n |
|
312 | 389 | ? p |
|
313 | 390 | ? q |
|
391 | #endif | |
|
314 | 392 | |
|
315 | 393 | The status process should return a consistent result and not crash. |
|
316 | 394 | |
@@ -323,6 +401,7 The status process should return a consi | |||
|
323 | 401 | $ cat $TESTTMP/status-race-lock.log |
|
324 | 402 | #else |
|
325 | 403 | #if rhg |
|
404 | #if pre-all-read | |
|
326 | 405 | $ cat $TESTTMP/status-race-lock.out |
|
327 | 406 | A dir/o |
|
328 | 407 | ? dir/n |
@@ -330,12 +409,46 The status process should return a consi | |||
|
330 | 409 | ? q |
|
331 | 410 | $ cat $TESTTMP/status-race-lock.log |
|
332 | 411 | #else |
|
412 | #if dirstate-v2-append | |
|
413 | $ cat $TESTTMP/status-race-lock.out | |
|
414 | A dir/o | |
|
415 | R dir/nested/m | |
|
416 | ! dir/i | |
|
417 | ! dir/j | |
|
418 | ! dir/nested/h | |
|
419 | ! dir2/k | |
|
420 | ! dir2/l | |
|
421 | ! g | |
|
422 | ? dir/n | |
|
423 | ? p | |
|
424 | ? q | |
|
425 | $ cat $TESTTMP/status-race-lock.log | |
|
426 | #else | |
|
427 | $ cat $TESTTMP/status-race-lock.out | |
|
428 | $ cat $TESTTMP/status-race-lock.log | |
|
429 | abort: dirstate-v2 parse error: not enough bytes on disk | |
|
430 | #endif | |
|
431 | #endif | |
|
432 | #else | |
|
333 | 433 | #if rust |
|
334 | 434 | #if dirstate-v2-rewrite |
|
335 | 435 | $ cat $TESTTMP/status-race-lock.out |
|
336 | 436 | $ cat $TESTTMP/status-race-lock.log |
|
337 | 437 | abort: $ENOENT$: '$TESTTMP/race-with-update/.hg/dirstate.* (glob) |
|
338 | 438 | #else |
|
439 | $ cat $TESTTMP/status-race-lock.out | |
|
440 | A dir/o | |
|
441 | R dir/nested/m | |
|
442 | ! dir/i | |
|
443 | ! dir/j | |
|
444 | ! dir/nested/h | |
|
445 | ! dir2/k | |
|
446 | ! dir2/l | |
|
447 | ! g | |
|
448 | ? dir/n | |
|
449 | ? p | |
|
450 | ? q | |
|
451 | $ cat $TESTTMP/status-race-lock.log | |
|
339 | 452 | #endif |
|
340 | 453 | #else |
|
341 | 454 | $ cat $TESTTMP/status-race-lock.out |
@@ -362,7 +475,7 spin a `hg status` with some caches to u | |||
|
362 | 475 | |
|
363 | 476 | $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \ |
|
364 | 477 | > --config rhg.on-unsupported=abort \ |
|
365 |
> --config |
|
|
478 | > --config ${cfg}=$TESTTMP/status-race-lock \ | |
|
366 | 479 | > & |
|
367 | 480 | $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting |
|
368 | 481 | do an update |
@@ -389,6 +502,16 The status process should return a consi | |||
|
389 | 502 | $ cat $TESTTMP/status-race-lock.log |
|
390 | 503 | #else |
|
391 | 504 | #if rhg |
|
505 | #if pre-all-read | |
|
506 | $ cat $TESTTMP/status-race-lock.out | |
|
507 | A dir/o | |
|
508 | R dir/nested/m | |
|
509 | ? dir/n | |
|
510 | ? p | |
|
511 | ? q | |
|
512 | $ cat $TESTTMP/status-race-lock.log | |
|
513 | #else | |
|
514 | #if dirstate-v2-append | |
|
392 | 515 | $ cat $TESTTMP/status-race-lock.out |
|
393 | 516 | A dir/o |
|
394 | 517 | R dir/nested/m |
@@ -397,12 +520,25 The status process should return a consi | |||
|
397 | 520 | ? q |
|
398 | 521 | $ cat $TESTTMP/status-race-lock.log |
|
399 | 522 | #else |
|
523 | $ cat $TESTTMP/status-race-lock.out | |
|
524 | $ cat $TESTTMP/status-race-lock.log | |
|
525 | abort: dirstate-v2 parse error: not enough bytes on disk | |
|
526 | #endif | |
|
527 | #endif | |
|
528 | #else | |
|
400 | 529 | #if rust |
|
401 | 530 | #if dirstate-v2-rewrite |
|
402 | 531 | $ cat $TESTTMP/status-race-lock.out |
|
403 | 532 | $ cat $TESTTMP/status-race-lock.log |
|
404 | 533 | abort: $ENOENT$: '$TESTTMP/race-with-status/.hg/dirstate.* (glob) |
|
405 | 534 | #else |
|
535 | $ cat $TESTTMP/status-race-lock.out | |
|
536 | A dir/o | |
|
537 | R dir/nested/m | |
|
538 | ? dir/n | |
|
539 | ? p | |
|
540 | ? q | |
|
541 | $ cat $TESTTMP/status-race-lock.log | |
|
406 | 542 | #endif |
|
407 | 543 | #else |
|
408 | 544 | $ cat $TESTTMP/status-race-lock.out |
General Comments 0
You need to be logged in to leave comments.
Login now