Comments (6)
@linusbarth Could you fix this? I suppose it is related to #1471.
from testify.
I'm not sure why your pull request fixes this. But I needed some time to even notice that not the test fails but rather this is just output from an internal test.
If I run the test (go test -v -race -run TestSubtestPanic -failfast ./suite
) on the branch from your 1502-PR, I see no difference in output. Is this correct?
Also wouldn't it be better to somehow manipulate/mark/remove the output from the internal tests? (If that's even possible)
from testify.
@linusbarth #1502 is just a fix for an issue I found thanks to your mistake, but is NOT the fix for 1501. #1503 IS the fix.
from testify.
Well. I think that we need both #1502 and #1503. So I will just rebase #1503 on top of #1502.
from testify.
We have another test failure in suite
:
$ go test -run TestSuiteWithStats -failfast -parallel 1 -count=1 ./suite
--- FAIL: WithStats (0.00s)
--- FAIL: WithStats/TestPanic (0.00s)
suite.go:87: test panicked: oops
goroutine 21 [running]:
runtime/debug.Stack()
/usr/local/Cellar/go/1.21.3/libexec/src/runtime/debug/stack.go:24 +0x5e
github.com/stretchr/testify/suite.failOnPanic(0xc000134340, {0x13ef4a0, 0x14f7f10})
/Users/omengue/go/src/github.com/stretchr/testify/suite/suite.go:87 +0x39
github.com/stretchr/testify/suite.Run.func1.1()
/Users/omengue/go/src/github.com/stretchr/testify/suite/suite.go:184 +0x24c
panic({0x13ef4a0?, 0x14f7f10?})
/usr/local/Cellar/go/1.21.3/libexec/src/runtime/panic.go:914 +0x21f
github.com/stretchr/testify/suite.(*suiteWithStats).TestPanic(0x0?)
/Users/omengue/go/src/github.com/stretchr/testify/suite/suite_test.go:549 +0x25
reflect.Value.call({0xc0000f9e00?, 0xc00009b008?, 0x13?}, {0x146993b, 0x4}, {0xc00004be70, 0x1, 0x1?})
/usr/local/Cellar/go/1.21.3/libexec/src/reflect/value.go:596 +0xce7
reflect.Value.Call({0xc0000f9e00?, 0xc00009b008?, 0x13d1b2f?}, {0xc000036670?, 0x11180cd?, 0x16d2098?})
/usr/local/Cellar/go/1.21.3/libexec/src/reflect/value.go:380 +0xb9
github.com/stretchr/testify/suite.Run.func1(0xc000134340)
/Users/omengue/go/src/github.com/stretchr/testify/suite/suite.go:198 +0x467
testing.tRunner(0xc000134340, 0xc00012e090)
/usr/local/Cellar/go/1.21.3/libexec/src/testing/testing.go:1595 +0xff
created by testing.(*T).Run in goroutine 20
/usr/local/Cellar/go/1.21.3/libexec/src/testing/testing.go:1648 +0x3ad
--- FAIL: TestSuiteWithStats (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x131fd22]
goroutine 19 [running]:
testing.tRunner.func1.2({0x1409f20, 0x17a5c80})
/usr/local/Cellar/go/1.21.3/libexec/src/testing/testing.go:1545 +0x238
testing.tRunner.func1()
/usr/local/Cellar/go/1.21.3/libexec/src/testing/testing.go:1548 +0x397
panic({0x1409f20?, 0x17a5c80?})
/usr/local/Cellar/go/1.21.3/libexec/src/runtime/panic.go:914 +0x21f
github.com/stretchr/testify/suite.TestSuiteWithStats(0x0?)
/Users/omengue/go/src/github.com/stretchr/testify/suite/suite_test.go:571 +0x242
testing.tRunner(0xc0000831e0, 0x149d878)
/usr/local/Cellar/go/1.21.3/libexec/src/testing/testing.go:1595 +0xff
created by testing.(*T).Run in goroutine 1
/usr/local/Cellar/go/1.21.3/libexec/src/testing/testing.go:1648 +0x3ad
FAIL github.com/stretchr/testify/suite 0.648s
FAIL
from testify.
#1503 didn't work. TestSubtestPanic
wasn't the only test to have issues.
#1504 is (hopefully) the real fix: use consistent subtest-like names for subtests when running them via testing.InternalTest and testing.RunTests.
from testify.
Related Issues (20)
- Guidance on re-using a shared SetupSuite across multiple packages
- Colorize the diffs produced by assert.Equal
- Error message on Len() assumes string HOT 2
- assert: add `ContainsFunc` to check a slice by func assertion HOT 2
- Add `Subset`/`ElementsMatch` by func assertion HOT 1
- use of mock HOT 1
- assert: accept values with named types in `InDelta*`, `InEpsilon*` HOT 2
- assert: EqualBody to check if two io.Readers have same data HOT 1
- suite.TestTeardown fail/panic is shadowing the cause panic HOT 2
- proposal: analogue of `InDeltaMapValues` with different deltas HOT 2
- proposal: new assertion`InEpsilonMapValues` HOT 3
- assert package deserve to be STD HOT 1
- Detect and fail on `require.*` methods called from a wrong goroutine HOT 5
- suite: missing signature check before calling Test* method HOT 3
- Support colorized output, indentation in accordance with subtest depth, and one more assertion HOT 3
- wall clock HOT 10
- assert.EqualExportedValues - panic: reflect.MakeSlice of non-slice type [recovered] HOT 6
- `suite.Require` deadlock HOT 1
- Assert: go test output shows subtests that fail as PASS HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testify.