Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

error: 1061: orphan end test #61

Open
tej24 opened this issue Sep 19, 2018 · 14 comments
Open

error: 1061: orphan end test #61

tej24 opened this issue Sep 19, 2018 · 14 comments

Comments

@tej24
Copy link

tej24 commented Sep 19, 2018

We are facing issue while running the below command for go2xunit package, since a month

command : go test -v $PKGS | $GOPATH/bin/go2xunit

error snippet
root@
****:# go test -v $PKGS | $GOPATH/bin/go2xunit -output tests.xml
error: 1044: orphan end test

root@*****:# go test -v $PKGS | $GOPATH/bin/go2xunit - (should output to console, but none)
error: 1036: orphan end test
*error snippet

go2xunit package version - 1.4.8

@tebeka
Copy link
Owner

tebeka commented Sep 19, 2018

Thanks @tej24 . Can you give me a bit more information?
Mostly I'd like to see the output of go test -v $PKGS. go version will be helpful as well

@tej24
Copy link
Author

tej24 commented Sep 19, 2018

@tebeka
List of files ( not exactly same in content though)
github.abc.def.hij/test/productapi.git/model/resourceCustomActionsModel github.abc.def.hij/test/productapi.git/model/resourceModel github.abc.def.hij/test/productapi.git/model/roleModel github.abc.def.hij/test/productapi.git/model/schedulerModel github.abc.def.hij/test/productapi.git/model/scriptTypeModel github.abc.def.hij/test/productapi.git/model/tagmodel github.abc.def.hij/test/productapi.git/model/templateModel github.abc.def.hij/test/productapi.git/model/ucmdbResourceModel github.abc.def.hij/test/productapi.git/util/clientutils github.abc.def.hij/test/productapi.git/util/constants github.abc.def.hij/test/productapi.git/webserver

go version go1.9.5 linux/amd64

@tebeka
Copy link
Owner

tebeka commented Sep 19, 2018

Thanks @tej24, The output of go test -v $PKGS will be much more helpful. If you can attach it (maybe mask information) it'll be much more helpful. Currently I don't have much to go on.

@fho
Copy link

fho commented Dec 10, 2018

@tebeka I'm getting the same error with some of our testcases.

Maybe it's related to that some of our testcases print something in json format to the console?

I ran:

go test -tags unit  ./... 2>&1

to generate the output: output.txt.

When I pass it to

cat output.txt | go2xunit -output junit

I get the error:

error: 5: orphan end test

and the output file is empty.


  • go version go1.11.2 linux/amd64
  • go2xunit 1.4.8

@tebeka
Copy link
Owner

tebeka commented Dec 17, 2018

IMO the test output is truncated. The first line in output.txt that gives any indication that it's a test is
--- FAIL: TestTriggerDueRemindersWhenAllARsAreDue (0.26s), there should be a RUN before it.

@tebeka tebeka closed this as completed Dec 17, 2018
@fho
Copy link

fho commented Dec 18, 2018

@tebeka yes, sorry, you are right. In the attached output.txt, I ran go test without the -v flag.

The orphan end test error happens reproducibly for multiple of our unit tests (also when passing the -v flag).

Attached is the output from another test run, where go2xunit fails to parse it with the error:

error: 10: orphan end test

gotestoutput.txt

If required I can provide more examples.

@tebeka
Copy link
Owner

tebeka commented Dec 19, 2018

Thanks. Will have a look soon.

@tebeka tebeka reopened this Dec 19, 2018
@tebeka
Copy link
Owner

tebeka commented Dec 24, 2018

Seems like you're running with t.Parallel? (CONT/PAUSE was added in go 1.10).

Currently t.Parallel is "problematic", see #29

@fho
Copy link

fho commented Dec 24, 2018

Yes, those tests were using t.parallel

@soniachan
Copy link

soniachan commented Jan 28, 2019

I am also hitting this error when I have fmt.Print for output instead of fmt.Println
ps. tests are not running with t.parallel

go version go1.10.3 linux/amd64
go2xunit 1.4.8

@tebeka
Copy link
Owner

tebeka commented Jan 28, 2019

Sorry for the slow updates. I'll try to solved this soon.

@kelbyers
Copy link

kelbyers commented Sep 5, 2019

I am seeing this problem, too. I have tests that are not using T.Parallel, but do test a gin based web service. Running my tests gives debug output from gin, along the lines of:

[GIN] 2019/09/05 - 14:24:14 | 400 |       12.38µs |                 | POST     /api/v1/launch
=== RUN   TestLaunch/Missing_cilist
[GIN] 2019/09/05 - 14:24:14 | 400 |      48.228µs |                 | POST     /api/v1/launch/wannaTest
=== RUN   TestLaunch/Minimal_request
[GIN] 2019/09/05 - 14:24:14 | 200 |     776.615µs |                 | POST     /api/v1/launch/wannaTest
Response: {Message: Error:false CiList:[node1] Description: Tags:[] JobNumber: CIStatus:[]}=== RUN   TestLaunch/Multiple_CIs
[GIN] 2019/09/05 - 14:24:14 | 200 |     567.495µs |                 | POST     /api/v1/launch/wannaTest

@tebeka
Copy link
Owner

tebeka commented Sep 12, 2019

Thanks @kelbyers, can you provide the input to go2xunit?

@kelbyers
Copy link

Sorry about the delay. In trying to get some data for you, we discovered that our test had some debug output that was printing as control characters, instead of taking an int and printing it as a string. It may well be a problem with our tests.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants