[PATCH] [RFC] tests: sleep for a second to let ui get flushed

Pulkit Goyal 7895pulkit at gmail.com
Thu Jul 23 21:01:14 UTC 2020


# HG changeset patch
# User Pulkit Goyal <7895pulkit at gmail.com>
# Date 1595538045 -19800
#      Fri Jul 24 02:30:45 2020 +0530
# Node ID ebb1da08c3163efac7bcfe0947c98b1ac01fc603
# Parent  aada79ccce4c3e424e48cc76598e0849be43de56
# EXP-Topic chg-test
[RFC] tests: sleep for a second to let ui get flushed

I was getting following failure on Python 3+chg:

```
--- /tmp/mercurial-ci/tests/test-blackbox.t
+++ /tmp/mercurial-ci/tests/test-blackbox.t.err
@@ -354,13 +354,13 @@
   > EOF
   $ hg log --debug
   removing $TESTTMP/gone/.hg
-  warning: cannot write to blackbox.log: $ENOENT$ (no-windows !)
   warning: cannot write to blackbox.log: $TESTTMP/gone/.hg/blackbox.log: $ENOTDIR$ (windows !)
   $ cd ..

 blackbox should disable itself if track is empty

   $ hg --config blackbox.track= init nothing_tracked
+  warning: cannot write to blackbox.log: $ENOENT$
   $ cd nothing_tracked
   $ cat >> .hg/hgrc << EOF
   > [blackbox]
ERROR: test-blackbox.t output changed
```

I added a sleep and debugged some more, it turns out that the command running is
finished even before the ui was completely flushed.

I have marked this as an RFC as I think adding code to wait for ui to flush
before chg exiting will be better.
However, will be nice to have a chg experienced person to look.

diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t
--- a/tests/test-blackbox.t
+++ b/tests/test-blackbox.t
@@ -354,8 +354,12 @@ Test missing log directory, which should
   > EOF
   $ hg log --debug
   removing $TESTTMP/gone/.hg
-  warning: cannot write to blackbox.log: $ENOENT$ (no-windows !)
   warning: cannot write to blackbox.log: $TESTTMP/gone/.hg/blackbox.log: $ENOTDIR$ (windows !)
+  warning: cannot write to blackbox.log: $ENOENT$ (no-windows !) (?)
+
+  $ sleep 1
+  warning: cannot write to blackbox.log: $ENOENT$ (no-windows !) (?)
+
   $ cd ..
 
 blackbox should disable itself if track is empty



More information about the Mercurial-devel mailing list