Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is these function in testing package should be filtered in default? #104

Closed
Mskxn opened this issue Mar 31, 2023 · 3 comments · Fixed by #105
Closed

Is these function in testing package should be filtered in default? #104

Mskxn opened this issue Mar 31, 2023 · 3 comments · Fixed by #105

Comments

@Mskxn
Copy link

Mskxn commented Mar 31, 2023

I got some FP with backtrace looks like this

        [Goroutine 1 in state chan receive, with testing.tRunner.func1 on top of the stack:
        goroutine 1 [chan receive]:
        testing.tRunner.func1()
        	C:/Users/Msk/go/go1.20rc3/src/testing/testing.go:1542 +0x4a5
        testing.tRunner(0xc0000376c0, 0xc000071c88)
        	C:/Users/Msk/go/go1.20rc3/src/testing/testing.go:1582 +0x144
        testing.runTests(0xc000055b80?, {0x16ac3a0, 0x1b, 0x1b}, {0xc00007c180?, 0x100c000071d10?, 0x0?})
        	C:/Users/Msk/go/go1.20rc3/src/testing/testing.go:2034 +0x489
        testing.(*M).Run(0xc000055b80)
        	C:/Users/Msk/go/go1.20rc3/src/testing/testing.go:1906 +0x63a
        main.main()
        	_testmain.go:101 +0x1aa
        ]

Indeed, these functions also occurs on the top of the stack, is them missed or by design?

testing.tRunner.func1"
"testing.(*F).Fuzz.func1"
"testing.runFuzzTests"
"testing.runFuzzing"
@JacobOaks
Copy link
Contributor

Hey, can you give us a repro for this?

@Mskxn
Copy link
Author

Mskxn commented Apr 12, 2023

They are found when using go/fuzzing to test the program. I don't have a stable repro but I think it is not related to a specific test case.

@sywhang
Copy link
Contributor

sywhang commented Apr 25, 2023

internal ref: GO-2002

EstebanOlmedo added a commit to EstebanOlmedo/goleak that referenced this issue Jun 27, 2023
When Fuzz testing, if the `-fuzz` flag is used then the fuzzing engine
is used to generate test cases out of the seed corpus, this causes
`testing.runFuzzTests` to be blocked until a failing input is found or
there is a signal to stop generating.
On the other hand `testing.runFuzzTests` is called even without the use
of the `-fuzz` flag, executes the input testing with all the elements
in the seed corpus and it's blocked until every test has run.

On both cases, goleak detects them as leaking goroutines, but this are
expected goroutines.

Internal Ref: GO-2002
Fix uber-go#104
r-hang pushed a commit that referenced this issue Jun 28, 2023
When Fuzz testing, if the `-fuzz` flag is used then the fuzzing engine
is used to generate test cases out of the seed corpus, this causes
`testing.runFuzzTests` to be blocked until a failing input is found or
there is a signal to stop generating.
On the other hand `testing.runFuzzTests` is called even without the use
of the `-fuzz` flag, executes the input testing with all the elements in
the seed corpus and it's blocked until every test has run.

On both cases, goleak detects them as leaking goroutines, but this are
expected goroutines.

Internal Ref: GO-2002
Fix #104
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants