Patchwork D1186: tests: de-flake test-run-tests.t's "--jobs=2 --first" test

login
register
mail settings
Submitter phabricator
Date Oct. 18, 2017, 11:31 p.m.
Message ID <differential-rev-PHID-DREV-rupzlb62o2ay553pcmtm-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/25226/
State Superseded
Headers show

Comments

phabricator - Oct. 18, 2017, 11:31 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Once in a while, test-nothing.t finished before test-failure.t or
  test-failure-copy.t (I haven't checked which one actually gets run
  first). Since there already are two tests that will fail in the same
  way, just run those two instead so the diff will be reproducible and
  not timing-dependent.
  
  The test case was added in https://phab.mercurial-scm.org/rHG9a20f53e436f42c2704b609b2f6ae1ee23ff0a0e (run-tests: handle --jobs and
  --first gracefully, 2014-10-09), and I have checked that backing that
  out results in two failures being printed. Note that the summary may
  still include multiple tests even if --first is given, it's just that
  the diff is only printed for the first failure.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1186

AFFECTED FILES
  tests/test-run-tests.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -609,10 +609,7 @@ 
   [1]
 
 failures in parallel with --first should only print one failure
-  >>> f = open('test-nothing.t', 'w')
-  >>> f.write('foo\n' * 1024) and None
-  >>> f.write('  $ sleep 1') and None
-  $ rt --jobs 2 --first
+  $ rt --jobs 2 --first test-failure*.t
   
   --- $TESTTMP/test-failure*.t (glob)
   +++ $TESTTMP/test-failure*.t.err (glob)
@@ -625,14 +622,14 @@ 
    pad pad pad pad............................................................
   
   Failed test-failure*.t: output changed (glob)
-  Failed test-nothing.t: output changed
+  Failed test-failure*.t: output changed (glob)
   # Ran 2 tests, 0 skipped, 2 failed.
   python hash seed: * (glob)
   [1]
 
 
 (delete the duplicated test file)
-  $ rm test-failure-copy.t test-nothing.t
+  $ rm test-failure-copy.t
 
 
 Interactive run