##// END OF EJS Templates
dirstate: add append/new-file variants in the dirstate's read race tests...
marmoute -
r51130:38597743 stable
parent child Browse files
Show More
@@ -3,6 +3,7 b' Check potential race conditions between '
3 ==============================================================================
3 ==============================================================================
4
4
5 #testcases dirstate-v1 dirstate-v2-append dirstate-v2-rewrite
5 #testcases dirstate-v1 dirstate-v2-append dirstate-v2-rewrite
6 #testcases pre-all-read pre-some-read
6
7
7 Some commands, like `hg status`, do not need to take the wlock but need to
8 Some commands, like `hg status`, do not need to take the wlock but need to
8 access dirstate data.
9 access dirstate data.
@@ -46,6 +47,17 b' Setup'
46 $ d2args="--config devel.dirstate.v2.data_update_mode=force-append"
47 $ d2args="--config devel.dirstate.v2.data_update_mode=force-append"
47 #endif
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 $ directories="dir dir/nested dir2"
61 $ directories="dir dir/nested dir2"
50 $ first_files="dir/nested/a dir/b dir/c dir/d dir2/e f"
62 $ first_files="dir/nested/a dir/b dir/c dir/d dir2/e f"
51 $ second_files="g dir/nested/h dir/i dir/j dir2/k dir2/l dir/nested/m"
63 $ second_files="g dir/nested/h dir/i dir/j dir2/k dir2/l dir/nested/m"
@@ -134,7 +146,7 b' spin a `hg status` with some caches to u'
134
146
135 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \
147 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \
136 > --config rhg.on-unsupported=abort \
148 > --config rhg.on-unsupported=abort \
137 > --config devel.sync.dirstate.pre-read-file=$TESTTMP/status-race-lock \
149 > --config ${cfg}=$TESTTMP/status-race-lock \
138 > &
150 > &
139 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
151 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
140
152
@@ -165,6 +177,7 b' The status process should return a consi'
165 $ cat $TESTTMP/status-race-lock.log
177 $ cat $TESTTMP/status-race-lock.log
166 #else
178 #else
167 #if rhg
179 #if rhg
180 #if pre-all-read
168 $ cat $TESTTMP/status-race-lock.out
181 $ cat $TESTTMP/status-race-lock.out
169 A dir/n
182 A dir/n
170 A dir/o
183 A dir/o
@@ -173,12 +186,34 b' The status process should return a consi'
173 ? q
186 ? q
174 $ cat $TESTTMP/status-race-lock.log
187 $ cat $TESTTMP/status-race-lock.log
175 #else
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 #if rust
204 #if rust
177 #if dirstate-v2-rewrite
205 #if dirstate-v2-rewrite
178 $ cat $TESTTMP/status-race-lock.out
206 $ cat $TESTTMP/status-race-lock.out
179 $ cat $TESTTMP/status-race-lock.log
207 $ cat $TESTTMP/status-race-lock.log
180 abort: $ENOENT$: '$TESTTMP/race-with-add/.hg/dirstate.* (glob)
208 abort: $ENOENT$: '$TESTTMP/race-with-add/.hg/dirstate.* (glob)
181 #else
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 #endif
217 #endif
183 #else
218 #else
184 $ cat $TESTTMP/status-race-lock.out
219 $ cat $TESTTMP/status-race-lock.out
@@ -203,7 +238,7 b' spin a `hg status with some cache to upd'
203
238
204 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \
239 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \
205 > --config rhg.on-unsupported=abort \
240 > --config rhg.on-unsupported=abort \
206 > --config devel.sync.dirstate.pre-read-file=$TESTTMP/status-race-lock \
241 > --config ${cfg}=$TESTTMP/status-race-lock \
207 > &
242 > &
208 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
243 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
209
244
@@ -245,18 +280,41 b' The status process should return a consi'
245 warning: ignoring unknown working parent 02a67a77ee9b! (no-rhg !)
280 warning: ignoring unknown working parent 02a67a77ee9b! (no-rhg !)
246 #else
281 #else
247 #if rhg
282 #if rhg
283 #if pre-all-read
248 $ cat $TESTTMP/status-race-lock.out
284 $ cat $TESTTMP/status-race-lock.out
249 ? dir/n
285 ? dir/n
250 ? p
286 ? p
251 ? q
287 ? q
252 $ cat $TESTTMP/status-race-lock.log
288 $ cat $TESTTMP/status-race-lock.log
253 #else
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 #if rust
305 #if rust
255 #if dirstate-v2-rewrite
306 #if dirstate-v2-rewrite
256 $ cat $TESTTMP/status-race-lock.out
307 $ cat $TESTTMP/status-race-lock.out
257 $ cat $TESTTMP/status-race-lock.log
308 $ cat $TESTTMP/status-race-lock.log
258 abort: $ENOENT$: '$TESTTMP/race-with-commit/.hg/dirstate.* (glob)
309 abort: $ENOENT$: '$TESTTMP/race-with-commit/.hg/dirstate.* (glob)
259 #else
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 #endif
318 #endif
261 #else
319 #else
262 $ cat $TESTTMP/status-race-lock.out
320 $ cat $TESTTMP/status-race-lock.out
@@ -281,7 +339,7 b' spin a `hg status` with some caches to u'
281
339
282 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \
340 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \
283 > --config rhg.on-unsupported=abort \
341 > --config rhg.on-unsupported=abort \
284 > --config devel.sync.dirstate.pre-read-file=$TESTTMP/status-race-lock \
342 > --config ${cfg}=$TESTTMP/status-race-lock \
285 > &
343 > &
286 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
344 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
287 do an update
345 do an update
@@ -301,6 +359,25 b' do an update'
301 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
359 0 files updated, 0 files merged, 6 files removed, 0 files unresolved
302 $ touch $TESTTMP/status-race-lock
360 $ touch $TESTTMP/status-race-lock
303 $ wait
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 $ hg log -GT '{node|short} {desc}\n'
381 $ hg log -GT '{node|short} {desc}\n'
305 o 9a86dcbfb938 more files to have two commit
382 o 9a86dcbfb938 more files to have two commit
306 |
383 |
@@ -311,6 +388,7 b' do an update'
311 ? dir/n
388 ? dir/n
312 ? p
389 ? p
313 ? q
390 ? q
391 #endif
314
392
315 The status process should return a consistent result and not crash.
393 The status process should return a consistent result and not crash.
316
394
@@ -323,6 +401,7 b' The status process should return a consi'
323 $ cat $TESTTMP/status-race-lock.log
401 $ cat $TESTTMP/status-race-lock.log
324 #else
402 #else
325 #if rhg
403 #if rhg
404 #if pre-all-read
326 $ cat $TESTTMP/status-race-lock.out
405 $ cat $TESTTMP/status-race-lock.out
327 A dir/o
406 A dir/o
328 ? dir/n
407 ? dir/n
@@ -330,12 +409,46 b' The status process should return a consi'
330 ? q
409 ? q
331 $ cat $TESTTMP/status-race-lock.log
410 $ cat $TESTTMP/status-race-lock.log
332 #else
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 #if rust
433 #if rust
334 #if dirstate-v2-rewrite
434 #if dirstate-v2-rewrite
335 $ cat $TESTTMP/status-race-lock.out
435 $ cat $TESTTMP/status-race-lock.out
336 $ cat $TESTTMP/status-race-lock.log
436 $ cat $TESTTMP/status-race-lock.log
337 abort: $ENOENT$: '$TESTTMP/race-with-update/.hg/dirstate.* (glob)
437 abort: $ENOENT$: '$TESTTMP/race-with-update/.hg/dirstate.* (glob)
338 #else
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 #endif
452 #endif
340 #else
453 #else
341 $ cat $TESTTMP/status-race-lock.out
454 $ cat $TESTTMP/status-race-lock.out
@@ -362,7 +475,7 b' spin a `hg status` with some caches to u'
362
475
363 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \
476 $ hg st >$TESTTMP/status-race-lock.out 2>$TESTTMP/status-race-lock.log \
364 > --config rhg.on-unsupported=abort \
477 > --config rhg.on-unsupported=abort \
365 > --config devel.sync.dirstate.pre-read-file=$TESTTMP/status-race-lock \
478 > --config ${cfg}=$TESTTMP/status-race-lock \
366 > &
479 > &
367 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
480 $ $RUNTESTDIR/testlib/wait-on-file 5 $TESTTMP/status-race-lock.waiting
368 do an update
481 do an update
@@ -389,6 +502,16 b' The status process should return a consi'
389 $ cat $TESTTMP/status-race-lock.log
502 $ cat $TESTTMP/status-race-lock.log
390 #else
503 #else
391 #if rhg
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 $ cat $TESTTMP/status-race-lock.out
515 $ cat $TESTTMP/status-race-lock.out
393 A dir/o
516 A dir/o
394 R dir/nested/m
517 R dir/nested/m
@@ -397,12 +520,25 b' The status process should return a consi'
397 ? q
520 ? q
398 $ cat $TESTTMP/status-race-lock.log
521 $ cat $TESTTMP/status-race-lock.log
399 #else
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 #if rust
529 #if rust
401 #if dirstate-v2-rewrite
530 #if dirstate-v2-rewrite
402 $ cat $TESTTMP/status-race-lock.out
531 $ cat $TESTTMP/status-race-lock.out
403 $ cat $TESTTMP/status-race-lock.log
532 $ cat $TESTTMP/status-race-lock.log
404 abort: $ENOENT$: '$TESTTMP/race-with-status/.hg/dirstate.* (glob)
533 abort: $ENOENT$: '$TESTTMP/race-with-status/.hg/dirstate.* (glob)
405 #else
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 #endif
542 #endif
407 #else
543 #else
408 $ cat $TESTTMP/status-race-lock.out
544 $ cat $TESTTMP/status-race-lock.out
General Comments 0
You need to be logged in to leave comments. Login now