h2non / gock

HTTP traffic mocking and testing made easy in Go ༼ʘ̚ل͜ʘ̚༽
https://pkg.go.dev/github.com/h2non/gock
MIT License
2.04k stars 106 forks source link

TestResponderPreExpiredContext fails with go1.16 and up #102

Open anthonyfok opened 1 year ago

anthonyfok commented 1 year ago

Starting with go1.16, TestResponderPreExpiredContext fails quite often, up to 80% of the time on my computer:

--- FAIL: TestResponderPreExpiredContext (0.00s)
    st.go:41: 
        responder_test.go:118: should be == 
            have: (<nil>) <nil>
            want: (context.deadlineExceededError) context deadline exceeded
    st.go:41: 
        responder_test.go:119: should be == 
            have: (bool) false
            want: (bool) true

With go1.15, TestResponderPreExpiredContext seemingly never fails.

Tested with gock.v1 v1.1.2 and the newer commit cd5aaaacd302f278fae7cbe9747fa56c859016fe on Debian sid.