Patchwork D11716: tests: better determinism in test-chg.t

login
register
mail settings
Submitter phabricator
Date Oct. 21, 2021, 11:20 a.m.
Message ID <differential-rev-PHID-DREV-4ijl5mgqoba5pvei7wyg-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50041/
State Superseded
Headers show

Comments

phabricator - Oct. 21, 2021, 11:20 a.m.
aalekseyev created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  chg tests fail pretty often with "Sample count: *" line disappearing.
  It disappears because the sample count is zero, in which case a custom message is printed.
  This commit makes the test succeed in that case.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-chg.t

CHANGE DETAILS




To: aalekseyev, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-chg.t b/tests/test-chg.t
--- a/tests/test-chg.t
+++ b/tests/test-chg.t
@@ -475,7 +475,7 @@ 
   $ hg init $TESTTMP/profiling
   $ cd $TESTTMP/profiling
   $ filteredchg() {
-  >   CHGDEBUG=1 chg "$@" 2>&1 | egrep 'Sample count|start cmdserver' || true
+  >   CHGDEBUG=1 chg "$@" 2>&1 | sed -rn 's_^No samples recorded.*$_Sample count: 0_; /Sample count/p; /start cmdserver/p'
   > }
   $ newchg() {
   >   chg --kill-chg-daemon