-
Notifications
You must be signed in to change notification settings - Fork 7
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
test fix: allow test scenarios run more than one time #10395
Conversation
Setting the logger in controller runtime only works for the first time, and is no-op the second time. this means that the second time the test runs it will run to a testing.T that finished running. The fix is to changing the underlying log writer, so we can swap up the testing.T to the current one
func NewTestLogger(t *testing.T) *zap.Logger { | ||
writer := &testingWriter{t: t} | ||
func NewTestLogger() *zap.Logger { | ||
//writer := &testingWriter{t: t} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can we delete?
also the comment on the constructor is now out of date, since it references testing.T
/skip-changelog |
/skipCI-kube-tests:true |
Visit the preview URL for this PR (updated for commit a2f62ce): https://gloo-edge--pr10395-yuval-k-setup-test-s-8ce4wug3.web.app (expires Tue, 03 Dec 2024 16:59:40 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 77c2b86e287749579b7ff9cadb81e099042ef677 |
note: i still see the 0 listener flake; i can't repro locally... I added some more logs in this PR, so next it happens in CI we will have more to go on |
/skip-changelog |
/skip-changelog |
/skip-changelog |
/skip-changelog |
/skip-changelog |
/skip-changelog |
Setting the logger in controller runtime only works for the first time, and is no-op the second time. this means that the second time the test runs it will run to a testing.T that finished running.
The fix is to changing the underlying log writer, so we can swap up the testing.T to the current one