[PATCH] test-logtoprocess: fix flaky test
Martin von Zweigbergk
martinvonz at google.com
Thu Feb 16 13:40:09 EST 2017
On Thu, Feb 16, 2017 at 10:34 AM, Jun Wu <quark at fb.com> wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1487270039 28800
> # Thu Feb 16 10:33:59 2017 -0800
> # Node ID 070d9b1d8c2528e8c247b5bcaeb69aea509619a1
> # Parent 6e6a461b5b60dc48a9e49cab2f3994b1345531fc
> # Available At https://bitbucket.org/quark-zju/hg-draft
> # hg pull https://bitbucket.org/quark-zju/hg-draft -r 070d9b1d8c25
> test-logtoprocess: fix flaky test
>
> Commands started by logtoprocess are running asynchronously. To be able to
> test the output, we need to block and wait for the output.
>
> The patch adds "| head -n 1" to the "hg log" command so its "asynchronous"
> output is waited and can be tested reliably.
Why not "cat"? Maybe also add a comment in the test case explaining
why it's needed?
>
> diff --git a/tests/test-logtoprocess.t b/tests/test-logtoprocess.t
> --- a/tests/test-logtoprocess.t
> +++ b/tests/test-logtoprocess.t
> @@ -67,4 +67,4 @@ Confirm that logging blocked time catche
> > EOF
>
> - $ hg log
> + $ hg log | head -n 1
> uiblocked stdio [0-9]+.[0-9]* ms command [0-9]+.[0-9]* ms (re)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
More information about the Mercurial-devel
mailing list