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

Don't apply monkey patches on generic start #8278

Merged
merged 1 commit into from
Jan 12, 2025

Conversation

lephilousophe
Copy link
Contributor

Since commit d6b698e, the monkey patches were applied on every installs.

This implies that set_is_in_unit_tests(True) was called even when not it in unit tests.

Because it believes being in tests, db.logs._async_iter_on_pool is importing NonThreadPool
from a submodule in the test module.
This runs the test init code which sets up warnings as error by default.

As a consequence, any Deprecation warning will trigger an exception
instead of just being shown in logs.

This is causing troubles in current v4.2.0 with out of tree modules (which use deprecated code, granted).
A backport would be great.

Contributor Checklist:

  • I have updated the unit tests
  • I have created a file in the newsfragments directory (and read the README.txt in that directory)
  • I have updated the appropriate documentation

@p12tic
Copy link
Member

p12tic commented Jan 10, 2025

I think it would make sense to bring back for_tests argument and keep enabling patch_servicechecks and patch_decorators on non-test.

@lephilousophe
Copy link
Contributor Author

Done.

Since commit d6b698e, the monkey
patches were applied on every installs.

This implies that set_is_in_unit_tests(True) was called even when not it
in unit tests.

Because it believes being in tests, db.logs._async_iter_on_pool is
importing NonThreadPool from a submodule in the test module.
This runs the test __init__ code which sets up warnings as error by
default.

As a consequence, any Deprecation warning will trigger an exception
instead of just being shown in logs.

This is causing troubles in current v4.2.0 with out of tree modules
(which use deprecated code, granted).

This partially reverts commit d6b698e.
In addition, some patches are always run and some only during tests.

Modified-by: Povilas Kanapickas <povilas@radix.lt>
This was referenced Jan 12, 2025
@p12tic
Copy link
Member

p12tic commented Jan 12, 2025

I added release note and also copied PR description to the commit comment.

@p12tic p12tic merged commit c35e3d1 into buildbot:master Jan 12, 2025
36 checks passed
@lephilousophe lephilousophe deleted the no-monkeypatch branch January 13, 2025 07:08
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