view tests/test-nested-repo.t @ 24507:a0668a587c04

run-tests: wait for test threads after first error The test runner has the ability to stop on first error. Tests are executed in new Python threads. The test runner starts new threads when it has capacity to do so. Before this patch, the "stop on first error" logic would return immediately from the "run tests" function, without waiting on test threads to complete. There was thus a race between the test runner thread doing cleanup work and the test thread performing activity. For example, the test thread could be in the middle of executing a test shell script and the test runner could remove the test's temporary directory. Depending on timing, this could result in any number of output from the test runner. This patch eliminates the race condition by having the test runner explicitly wait for test threads to complete before continuing. I discovered this issue as I modified the test harness in a subsequent patch and was reliably able to tickle the race condition.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 28 Mar 2015 19:39:03 -0700
parents 4cdec37f0018
children 4441705b7111
line wrap: on
line source

  $ hg init a
  $ cd a
  $ hg init b
  $ echo x > b/x

Should print nothing:

  $ hg add b
  $ hg st

  $ echo y > b/y
  $ hg st

Should fail:

  $ hg st b/x
  abort: path 'b/x' is inside nested repo 'b' (glob)
  [255]
  $ hg add b/x
  abort: path 'b/x' is inside nested repo 'b' (glob)
  [255]

Should fail:

  $ hg add b b/x
  abort: path 'b/x' is inside nested repo 'b' (glob)
  [255]
  $ hg st

Should arguably print nothing:

  $ hg st b

  $ echo a > a
  $ hg ci -Ama a

Should fail:

  $ hg mv a b
  abort: path 'b/a' is inside nested repo 'b' (glob)
  [255]
  $ hg st

  $ cd ..