Skip to content

fix: improve Error Trace output#92

Merged
fredbi merged 1 commit into
go-openapi:masterfrom
boekkooi-impossiblecloud:improve-error-output
Apr 16, 2026
Merged

fix: improve Error Trace output#92
fredbi merged 1 commit into
go-openapi:masterfrom
boekkooi-impossiblecloud:improve-error-output

Conversation

@boekkooi-impossiblecloud

@boekkooi-impossiblecloud boekkooi-impossiblecloud commented Apr 16, 2026

Copy link
Copy Markdown

Change type

🔧 Bug fix

Short description

When using EventuallyWith the failure always show the testing.go:110 as the source which makes things hard to debug.
This PR resolves that issue.

Fixes

package cache

import (
	"testing"
	"time"

	"github.com/go-openapi/testify/v2/assert"
)

func TestExample_Failure(t *testing.T) {
	assert.EventuallyWith(t, func(collect *assert.CollectT) {
		time.Sleep(time.Millisecond)
	}, 2*time.Microsecond, time.Microsecond)
}

Current behavior

=== RUN   TestExample_Failure
    condition.go:558: context deadline exceeded
    testing.go:110: 
        	Error Trace:	/home/warnar/.asdf/installs/golang/1.26.2/go/src/runtime/asm_amd64.s:1771
        	Error:      	condition never satisfied
        	Test:       	TestExample_Failure
    condition.go:334: context deadline exceeded
--- FAIL: TestExample_Failure (0.00s)

FAIL

New behavior

=== RUN   TestExample_Failure
    example_test.go:11:
        	Error Trace:	example_test.go:11
        	Error:      	condition never satisfied
        	Test:       	TestExample_Failure
--- FAIL: TestExample_Failure (0.00s)

FAIL

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.
Signed-off-by: warnar boekkooi <wboekkooi@impossiblecloud.com>

@fredbi fredbi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes obviously.
Excellent catch, thank you.

@codecov

codecov Bot commented Apr 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.34%. Comparing base (b635c75) to head (4d7fcb0).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #92   +/-   ##
=======================================
  Coverage   91.34%   91.34%           
=======================================
  Files          93       93           
  Lines       12056    12058    +2     
=======================================
+ Hits        11012    11014    +2     
  Misses        830      830           
  Partials      214      214           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fredbi fredbi merged commit 56b8ecb into go-openapi:master Apr 16, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants