Closed eclipseo closed 3 years ago
@eclipseo - There are known issues surrounding assertions against map[string]interface{}
:
Might this be a duplicate issue?
It doesn't look like it, it is specific to 1.16, 1.15 works.
@eclipseo - I've tried to replicate the failure with the following test case:
func TestIssue42(t *testing.T) {
a := map[interface{}]struct {}{1:{}, 2:{}, 3:{}, "foo":{}}
b := map[interface{}]struct {}{3:{}, 1:{}, 2:{}, "foo":{}}
New(t).So(a, ShouldResemble, b)
}
Here's the output I'm getting on 64-bit Ubuntu 20.04.1 LTS:
mike@mikewhat:~/code/src/github.com/smartystreets/assertions$ ~/Desktop/go1.16/go/bin/go version
go version go1.16beta1 linux/amd64
mike@mikewhat:~/code/src/github.com/smartystreets/assertions$ ~/Desktop/go1.16/go/bin/go test -v -run TestIssue42
=== RUN TestIssue42
--- PASS: TestIssue42 (0.00s)
PASS
ok github.com/smartystreets/assertions 0.001s
So, I'm not able to replicate. Did I get the test right? (does the above test case fail on your system?) Or is this failure specific to your architecture?
@eclipseo - I've tried to replicate the failure with the following test case:
func TestIssue42(t *testing.T) { a := map[interface{}]struct {}{1:{}, 2:{}, 3:{}, "foo":{}} b := map[interface{}]struct {}{3:{}, 1:{}, 2:{}, "foo":{}} New(t).So(a, ShouldResemble, b) }
Here's the output I'm getting on 64-bit Ubuntu 20.04.1 LTS:
mike@mikewhat:~/code/src/github.com/smartystreets/assertions$ ~/Desktop/go1.16/go/bin/go version go version go1.16beta1 linux/amd64 mike@mikewhat:~/code/src/github.com/smartystreets/assertions$ ~/Desktop/go1.16/go/bin/go test -v -run TestIssue42 === RUN TestIssue42 --- PASS: TestIssue42 (0.00s) PASS ok github.com/smartystreets/assertions 0.001s
So, I'm not able to replicate. Did I get the test right? (does the above test case fail on your system?) Or is this failure specific to your architecture?
I have no issue with other arches, only on s390x, which is tricky to test as it's on a CI system I don't have access to. It's probably a change made to Go dusing the 1.16 window but I haven't been able to find any clue in the commit log. Maybe I should report to upstream Go with your testcase is I manage to reproduce it.
(Full log https://koji.fedoraproject.org/koji/taskinfo?taskID=60502076)
@eclipseo - Yeah, it very well could be an issue with Go that should be reported. But you'll probably need to come up with code to reproduce the problem but ideally that code would be independent of this library. Can you isolate the change to a single method call in the ShouldResemble
behavior? For instance, is it the call to reflect.DeepEqual()
(or maybe somewhere close to that)?
Looks related to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008443 . distro : debian/sid go version : 1.18
On Fedora rawhide, Golang 1.16 beta 1, s390x architecture, the following test fail: