Skip to content

Conversation

@NastyaAR
Copy link
Contributor

This problem occured due to parallel reading of os.Stderr (logger.Initialize ->logger.InitializeWithEnv -> zap.Config.Build) and writing to it when intercepting stderr in TestFindClientConfigs.

Changes

  • added InitializeTest() for creating zaptest/observer in-memory logs
  • fixed TestFindClientConfigs()

 * new function for initialize test logger

Signed-off-by: NastyaAR <[email protected]>
Copy link
Member

@eleftherias eleftherias left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @NastyaAR!
The overall approach looks good, I've left a few comments inline.

 * transfer init test logger function from logger to config_test, make it helper

 * add cleanup with restoring original logger

 * make test sequential

Signed-off-by: NastyaAR <[email protected]>
@codecov
Copy link

codecov bot commented Oct 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.75%. Comparing base (9f46bff) to head (fe96cf7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2178      +/-   ##
==========================================
- Coverage   54.77%   54.75%   -0.03%     
==========================================
  Files         272      272              
  Lines       25757    25757              
==========================================
- Hits        14109    14103       -6     
- Misses      10328    10332       +4     
- Partials     1320     1322       +2     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@eleftherias eleftherias left a comment

Choose a reason for hiding this comment

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

Thanks for the updates @NastyaAR!
Our automated linter flagged some issues, which I've listed in the comments below.
You can run task lint to check if there are any linter issues before committing.

@eleftherias eleftherias merged commit f1705ca into stacklok:main Nov 3, 2025
26 checks passed
@eleftherias
Copy link
Member

Thank you for your contribution @NastyaAR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants