test-debugcommands.t fails on windows because of changed output order

Mads Kiilerich mads at kiilerich.com
Mon Jan 20 05:18:43 CST 2014


On 01/20/2014 12:05 PM, Simon Heimberg wrote:
> Why does debugstacktrace return the traces in a different order on 
> windows? Any idea?
> Are the two output versions valid (with #if in test) or should the 
> problems source be located?
>
> On linux (is the expected test result) printing "hello world at:" and 
> its stack trace is first.
> On windows, the same is printed after the other stack trace (which 
> prints "stacktrace at:").
>
>
> expected test-debugcommands.t output:
> @@ -37,11 +37,11 @@
>   > g()
>   > EOF
>   $ python debugstacktrace.py
>   hello world at:
>    debugstacktrace.py:7 in * (glob)
>    debugstacktrace.py:5 in g
>    debugstacktrace.py:3 in f
>   stacktrace at:
>    debugstacktrace.py:7 *in * (glob)
>    debugstacktrace.py:6 *in g (glob)
>    */util.py:* in debugstacktrace (glob)
>
> output from test-debugcommands.t on windows, rewritten from the rest 
> result [1]:
> @@ -37,11 +37,11 @@
>   > g()
>   > EOF
>   $ python debugstacktrace.py
>   stacktrace at:
>    debugstacktrace.py:7 *in * (glob)
>    debugstacktrace.py:6 *in g (glob)
>    */util.py:* in debugstacktrace (glob)
>   hello world at:\r (esc)
>    debugstacktrace.py:7 *in * (glob)
>    debugstacktrace.py:5 in g
>    debugstacktrace.py:3 in f

That would be because of different buffering of stdout.

I guess the test should add a sys.stdout.flush() after the sys.stdout 
... or test with sys.stderr before sys.stdout ... or just not care about 
testing both ... or ...

/Mads



More information about the Mercurial-devel mailing list