buildbot icon indicating copy to clipboard operation
buildbot copied to clipboard

Version 4.2.1 treats warnings as exceptions

Open deboshir73 opened this issue 9 months ago • 2 comments

Description

Current version (4.2.1, maybe the previous one too) converts all warnings into exceptions. Output of warnings filter shows: ('error', None, <class 'Warning'>, None, 0) In my case, in particular, it blocks sending HTTPS requests with parameter verify=False.

Possible reason

File config/master.py contains variable _in_unit_tests, which set to False by default but it become True after calling monkeypatches, so function get_is_in_unit_tests() starts to return True.

File db/logs.py contains code:

...
 if get_is_in_unit_tests():
        from buildbot.test.fake.reactor import NonThreadPool
...

Importing test.fake.reactor here leads to call warnings.filterwarnings('error') from test/__init__.py

deboshir73 avatar Mar 31 '25 20:03 deboshir73

I can confirm this. I'm currently working this around by:

import buildbot.config.master
buildbot.config.master.get_is_in_unit_tests = lambda: False
import buildbot.db.logs
buildbot.db.logs.get_is_in_unit_tests = lambda: False

in buildmaster config.

Related: #8278

pocek avatar Apr 23 '25 10:04 pocek

Is this fixed in 4.3.0 for you?

p12tic avatar May 14 '25 19:05 p12tic