FAQ
Context: I'm trying to parse test output with go2xunit
<https://bitbucket.org/tebeka/go2xunit>.

go2xunit gets confused if it sees one test end when a different test
started more recently. Is a bug or WAI?

The comments in cmd/go/test.go
<https://github.com/golang/go/blob/e05b48e2/src/cmd/go/test.go#L355> about
avoiding mixed output point to it being a bug. However, the tests are
parallel: you can't unmix their stdout/stderr.

To reproduce, run the attached go-test-mingled-output.sh.

Sample output:

GOMAXPROCS=2 go test -v -parallel 2 ./foo ./bar
*=== RUN TestOne*
*=== RUN TestTwo*
This is output from TestTwo
This is output from TestOne
*--- PASS: TestOne (0.10s)*
*--- PASS: TestTwo (0.10s)*
PASS
ok _/Users/zellyn/tmp/parallel-tests/foo 0.109s
*=== RUN TestOne*
*=== RUN TestTwo*
This is output from TestTwo
This is output from TestOne
*--- PASS: TestTwo (0.10s)*
*--- PASS: TestOne (0.10s)*
PASS
ok _/Users/zellyn/tmp/parallel-tests/bar 0.112s

Zellyn

cc'd Miki Tebeka, the go2xunit author. FWIW, Miki, I'm getting what you'd
expect: errors like "error: 86: orphan end test" or "error: 6: name
mismatch (try disabling parallel mode)"

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Miki Tebeka at Dec 15, 2015 at 10:35 am
    Sorry for the delay in reply - been away.

    This is working at intended - for now :) Taking from the zen of Python -
    "In the face of ambiguity, refuse the temptation to guess." Maybe when bug
    2981 <https://github.com/golang/go/issues/2981> is implemeneted we'll be
    able to do it.
    On Thursday, December 10, 2015 at 8:34:07 AM UTC-8, Zellyn wrote:

    Context: I'm trying to parse test output with go2xunit
    <https://bitbucket.org/tebeka/go2xunit>.

    go2xunit gets confused if it sees one test end when a different test
    started more recently. Is a bug or WAI?

    The comments in cmd/go/test.go
    <https://github.com/golang/go/blob/e05b48e2/src/cmd/go/test.go#L355>
    about avoiding mixed output point to it being a bug. However, the tests are
    parallel: you can't unmix their stdout/stderr.

    To reproduce, run the attached go-test-mingled-output.sh.

    Sample output:

    GOMAXPROCS=2 go test -v -parallel 2 ./foo ./bar
    *=== RUN TestOne*
    *=== RUN TestTwo*
    This is output from TestTwo
    This is output from TestOne
    *--- PASS: TestOne (0.10s)*
    *--- PASS: TestTwo (0.10s)*
    PASS
    ok _/Users/zellyn/tmp/parallel-tests/foo 0.109s
    *=== RUN TestOne*
    *=== RUN TestTwo*
    This is output from TestTwo
    This is output from TestOne
    *--- PASS: TestTwo (0.10s)*
    *--- PASS: TestOne (0.10s)*
    PASS
    ok _/Users/zellyn/tmp/parallel-tests/bar 0.112s

    Zellyn

    cc'd Miki Tebeka, the go2xunit author. FWIW, Miki, I'm getting what you'd
    expect: errors like "error: 86: orphan end test" or "error: 6: name
    mismatch (try disabling parallel mode)"
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Zellyn Hunter at Dec 15, 2015 at 2:01 pm
    Yeah, I'm tempted to go write a strawman implementation fixing that bug :-)

    We just want timing and pass/fail information right now (we're trying to
    find flaky and slow tests), so I may just fork go2xunit and make it handle
    parallel tests, while throwing away the output. It's tricky though -
    there's no real way to blame a data race on a particular test if they're
    running in parallel, for instance.

    Zellyn
    On Tue, Dec 15, 2015 at 5:35 AM Miki Tebeka wrote:

    Sorry for the delay in reply - been away.

    This is working at intended - for now :) Taking from the zen of Python -
    "In the face of ambiguity, refuse the temptation to guess." Maybe when bug
    2981 <https://github.com/golang/go/issues/2981> is implemeneted we'll be
    able to do it.

    On Thursday, December 10, 2015 at 8:34:07 AM UTC-8, Zellyn wrote:

    Context: I'm trying to parse test output with go2xunit
    <https://bitbucket.org/tebeka/go2xunit>.

    go2xunit gets confused if it sees one test end when a different test
    started more recently. Is a bug or WAI?

    The comments in cmd/go/test.go
    <https://github.com/golang/go/blob/e05b48e2/src/cmd/go/test.go#L355>
    about avoiding mixed output point to it being a bug. However, the tests are
    parallel: you can't unmix their stdout/stderr.

    To reproduce, run the attached go-test-mingled-output.sh.

    Sample output:

    GOMAXPROCS=2 go test -v -parallel 2 ./foo ./bar
    *=== RUN TestOne*
    *=== RUN TestTwo*
    This is output from TestTwo
    This is output from TestOne
    *--- PASS: TestOne (0.10s)*
    *--- PASS: TestTwo (0.10s)*
    PASS
    ok _/Users/zellyn/tmp/parallel-tests/foo 0.109s
    *=== RUN TestOne*
    *=== RUN TestTwo*
    This is output from TestTwo
    This is output from TestOne
    *--- PASS: TestTwo (0.10s)*
    *--- PASS: TestOne (0.10s)*
    PASS
    ok _/Users/zellyn/tmp/parallel-tests/bar 0.112s

    Zellyn

    cc'd Miki Tebeka, the go2xunit author. FWIW, Miki, I'm getting what you'd
    expect: errors like "error: 86: orphan end test" or "error: 6: name
    mismatch (try disabling parallel mode)"
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "golang-nuts" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/golang-nuts/RAXk0ZmYKpg/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Miki Tebeka at Dec 16, 2015 at 5:18 am
    LMK when you have a solution and I'll take a look. Maybe add it with a
    command line switch to go2xunit.
    On Tuesday, December 15, 2015 at 4:01:28 PM UTC+2, Zellyn wrote:

    Yeah, I'm tempted to go write a strawman implementation fixing that bug :-)

    We just want timing and pass/fail information right now (we're trying to
    find flaky and slow tests), so I may just fork go2xunit and make it handle
    parallel tests, while throwing away the output. It's tricky though -
    there's no real way to blame a data race on a particular test if they're
    running in parallel, for instance.

    Zellyn

    On Tue, Dec 15, 2015 at 5:35 AM Miki Tebeka <miki....@gmail.com
    <javascript:>> wrote:
    Sorry for the delay in reply - been away.

    This is working at intended - for now :) Taking from the zen of Python -
    "In the face of ambiguity, refuse the temptation to guess." Maybe when bug
    2981 <https://github.com/golang/go/issues/2981> is implemeneted we'll be
    able to do it.

    On Thursday, December 10, 2015 at 8:34:07 AM UTC-8, Zellyn wrote:

    Context: I'm trying to parse test output with go2xunit
    <https://bitbucket.org/tebeka/go2xunit>.

    go2xunit gets confused if it sees one test end when a different test
    started more recently. Is a bug or WAI?

    The comments in cmd/go/test.go
    <https://github.com/golang/go/blob/e05b48e2/src/cmd/go/test.go#L355>
    about avoiding mixed output point to it being a bug. However, the tests are
    parallel: you can't unmix their stdout/stderr.

    To reproduce, run the attached go-test-mingled-output.sh.

    Sample output:

    GOMAXPROCS=2 go test -v -parallel 2 ./foo ./bar
    *=== RUN TestOne*
    *=== RUN TestTwo*
    This is output from TestTwo
    This is output from TestOne
    *--- PASS: TestOne (0.10s)*
    *--- PASS: TestTwo (0.10s)*
    PASS
    ok _/Users/zellyn/tmp/parallel-tests/foo 0.109s
    *=== RUN TestOne*
    *=== RUN TestTwo*
    This is output from TestTwo
    This is output from TestOne
    *--- PASS: TestTwo (0.10s)*
    *--- PASS: TestOne (0.10s)*
    PASS
    ok _/Users/zellyn/tmp/parallel-tests/bar 0.112s

    Zellyn

    cc'd Miki Tebeka, the go2xunit author. FWIW, Miki, I'm getting what
    you'd expect: errors like "error: 86: orphan end test" or "error: 6: name
    mismatch (try disabling parallel mode)"
    --
    You received this message because you are subscribed to a topic in the
    Google Groups "golang-nuts" group.
    To unsubscribe from this topic, visit
    https://groups.google.com/d/topic/golang-nuts/RAXk0ZmYKpg/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    golang-nuts...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 10, '15 at 4:34p
activeDec 16, '15 at 5:18a
posts4
users2
websitegolang.org

2 users in discussion

Miki Tebeka: 2 posts Zellyn Hunter: 2 posts

People

Translate

site design / logo © 2022 Grokbase