Skip to content
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

twister: setup logging per process, fix logging on macos #86240

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

nashif
Copy link
Member

@nashif nashif commented Feb 24, 2025

not sure why on MacOS it behaves differently, but this seems to fix the issue

Fixes #86237

@nashif nashif changed the title twister: setup logging per process twister: setup logging per process, fix logging on macos Feb 24, 2025
@nashif
Copy link
Member Author

nashif commented Feb 24, 2025

looks like the fix works, see CI:

image

@nashif nashif marked this pull request as ready for review February 24, 2025 14:16
@zephyrbot zephyrbot added the area: Twister Twister label Feb 24, 2025
@nashif
Copy link
Member Author

nashif commented Feb 24, 2025

@LukaszMrugala can you help with the pytest mocking here, not sure how to resolve this.

@fabiobaltieri
Copy link
Member

Seems like the Windows build had the same issue and also work now.

@nashif
Copy link
Member Author

nashif commented Feb 24, 2025

Seems like the Windows build had the same issue and also work now.

oh yeah, that is good. suprised nobody noticed this before ;-(

@nashif nashif added this to the v4.1.0 milestone Feb 24, 2025
PerMac
PerMac previously approved these changes Feb 25, 2025
Copy link
Member

@PerMac PerMac left a comment

Choose a reason for hiding this comment

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

lgtm, verified that it improvers logging on windows

@LukaszMrugala
Copy link
Collaborator

It fails Unit tests because in the test_projectbuilder_process test there is an options Mock. Since new options are used after this change in the runner, those options default to mock.MagicMock(), which breaks the test.

Adding this piece of code to the test (L1533) fixes the problem (note that the tmp_path must be also added as the test parameter):

    pb.options.outdir = tmp_path
    pb.options.log_file = None
    pb.options.log_level = "DEBUG"

@nashif
Copy link
Member Author

nashif commented Feb 25, 2025

It fails Unit tests because in the test_projectbuilder_process test there is an options Mock. Since new options are used after this change in the runner, those options default to mock.MagicMock(), which breaks the test.

Adding this piece of code to the test (L1533) fixes the problem (note that the tmp_path must be also added as the test parameter):

    pb.options.outdir = tmp_path
    pb.options.log_file = None
    pb.options.log_level = "DEBUG"

does not work, can you please post a patch here

@nashif nashif force-pushed the topic/twister/macos_logging branch 4 times, most recently from be0b3e0 to fa50754 Compare February 25, 2025 17:53
@fabiobaltieri
Copy link
Member

not sure why on MacOS it behaves differently

https://en.wikipedia.org/wiki/Think_different

@nashif nashif force-pushed the topic/twister/macos_logging branch from fa50754 to b7795a5 Compare February 27, 2025 12:14
@nashif
Copy link
Member Author

nashif commented Feb 27, 2025

rebased

Setup logging per process to fix issue on both mac and windows where
handlers are not available to the processes.

Fixes zephyrproject-rtos#86237

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
@nashif nashif force-pushed the topic/twister/macos_logging branch from b7795a5 to aa3d874 Compare February 27, 2025 22:38
@kartben kartben merged commit a7e2846 into zephyrproject-rtos:main Feb 28, 2025
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

twister: logging messages dropped when in verbose mode on MacOS
6 participants