Package: src:python-os-collect-config
Version: 14.0.1-1
Severity: serious
Tags: ftbfs forky sid patch

Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202609/

Notes:

* The failing tests are these two:

FAIL: os_collect_config.tests.test_collect.TestConf.test_setup_conf
FAIL: os_collect_config.tests.test_ec2.TestEc2.test_collect_ec2_collected

but it may be the case that not always both of them fail.


* I can reproduce the issue on machines with 1 CPU and 2 CPUs,
but the failure rate is a lot higher (around 100%) on machines with 1 CPU.


* I asked DeepSeek V4 Flash about the reason for these failures, and
apparently the problem is that there is not enough cleanup between one test
and the next one.

It offered me the attached patch, which I tried and it seems to work.

The usual caveats apply. My recommendation is that you forward
the issue upstream to begin with. The patch may not be perfect
but the fact that it seems to work is a very good hint about
the nature of the problem.


About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:python-os-collect-config, so that this is 
still
visible in the BTS web page for this package.

Thanks.

--------------------------------------------------------------------------------
[...]

os_collect_config.tests.test_request.TestRequestSoftwareConfig.test_collect_request
 ... ok
{
 "tmpz7d0lrnm": {
  "localstrA": "A",
  "localint9": 9,
  "localmap_xy": {
   "x": 42,
   "y": "foo"
  }
 }
}
{}
{}

======================================================================
FAIL: os_collect_config.tests.test_collect.TestConf.test_setup_conf
os_collect_config.tests.test_collect.TestConf.test_setup_conf
----------------------------------------------------------------------
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/os_collect_config/tests/test_collect.py", line 558, in 
test_setup_conf
    self.assertEqual('/var/lib/os-collect-config', cfg.CONF.cachedir)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 513, in 
assertEqual
    self.assertThat(observed, matcher, message)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/testtools/testcase.py", line 704, in 
assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: '/var/lib/os-collect-config' != 
'/tmp/tmpk_b13l7l'


----------------------------------------------------------------------
Ran 93 tests in 1.048s

FAILED (failures=1)
+ echo ======> STESTR TEST SUITE FAILED FOR python3.14: displaying pip3 freeze 
output...
======> STESTR TEST SUITE FAILED FOR python3.14: displaying pip3 freeze 
output...
+ [ -x /usr/bin/pip3 ]
+ pip3 freeze
WARNING: The directory '/sbuild-nonexistent/.cache/pip' or its parent directory 
is not owned or is not writable by the current user. The cache has been 
disabled. Check the permissions and owner of that directory. If executing pip 
with sudo, you should use sudo's -H flag.
alabaster==1.0.0
attrs==26.1.0
autocommand==2.2.2
autopage==0.6.0
babel==2.18.0
bcrypt==5.0.0
blinker==1.9.0
certifi==2026.7.22
chardet==5.2.0
charset-normalizer==3.4.7
cliff==4.16.0
cmd2==4.2.0+ds
coverage==7.16.1
cryptography==49.0.0
debtcollector==3.1.0
decorator==5.3.1
defusedxml==0.7.1
deprecation==2.1.0
docutils==0.23
dogpile.cache==1.5.0
fixtures==4.3.0
flake8==7.3.0
hacking==8.1.0
idna==3.19
imagesize==2.0.1
iso8601==2.1.0
jaraco.context==6.0.1
jaraco.functools==4.1.0
Jinja2==3.1.6
jmespath==1.0.1
jsonpatch==1.33
jsonpointer==2.4
jsonschema==4.26.0
jsonschema-specifications==2025.9.1
keystoneauth1==5.17.0
linkify-it-py==2.1.0
lxml==6.1.3
Mako==1.3.10.dev0
markdown-it-py==4.2.0
MarkupSafe==3.0.3
mccabe==0.7.0
mdurl==0.1.2
more-itertools==11.1.0
msgpack==1.2.1
netaddr==1.3.0
oauthlib==3.3.1
openstacksdk==4.20.0
os-collect-config==14.0.1
os-service-types==1.9.0
osc-lib==4.7.0
oslo.config==10.7.0
oslo.context==6.5.0
oslo.i18n==6.9.0
oslo.log==8.3.2
oslo.serialization==5.11.0
oslo.utils==10.2.0
packaging==26.2
pbr==7.1.1
platformdirs==4.11.9
prettytable==3.17.0
prompt_toolkit==3.0.53
psutil==7.2.2
pycodestyle==2.14.0
pyflakes==3.4.0
Pygments==2.20.0
PyJWT==2.14.0
pyparsing==3.3.2
pyperclip==1.11.0
python-dateutil==2.9.0
python-heatclient==5.3.0
python-keystoneclient==6.0.0
python-subunit==1.4.6
python-swiftclient==4.11.0
python-zaqarclient==4.7.0
PyYAML==6.0.3
referencing==0.37.0
requests==2.34.2
rfc3986==2.0.0
rich==15.0.0
rich-argparse==1.8.0
roman-numerals==4.1.0
rpds-py==0.30.0
setuptools==84.0.0
snowballstemmer==3.1.1
Sphinx==9.1.0
stestr==4.2.1
stevedore==5.9.1
testtools==2.9.1
tomlkit==0.13.3
typing_extensions==4.16.0
uc-micro-py==2.0.0
urllib3==2.8.0
voluptuous==0.16.0
wcwidth==0.8.3
wheel==0.47.0
wrapt==2.3.0
zipp==3.23.0
+ exit 1
make[1]: *** [debian/rules:22: override_dh_auto_install] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:7: binary] Error 2
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit 
status 2
--------------------------------------------------------------------------------
--- a/os_collect_config/tests/test_collect.py
+++ b/os_collect_config/tests/test_collect.py
@@ -13,7 +13,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import copy
 import json
 import os
 import signal
@@ -360,16 +359,12 @@
         super().setUp()
         self.log = self.useFixture(fixtures.FakeLogger())
         collect.setup_conf()
+        self.addCleanup(cfg.CONF.reset)
         self.cache_dir = self.useFixture(fixtures.TempDir())
         self.backup_cache_dir = self.useFixture(fixtures.TempDir())
-        self.clean_conf = copy.copy(cfg.CONF)
-
-        def restore_copy():
-            cfg.CONF = self.clean_conf
-        self.addCleanup(restore_copy)
 
-        cfg.CONF.cachedir = self.cache_dir.path
-        cfg.CONF.backup_cachedir = self.backup_cache_dir.path
+        cfg.CONF.set_override('cachedir', self.cache_dir.path)
+        cfg.CONF.set_override('backup_cachedir', self.backup_cache_dir.path)
         cfg.CONF.cfn.metadata_url = 'http://192.0.2.1:8000/v1/'
         cfg.CONF.cfn.stack_name = 'foo'
         cfg.CONF.cfn.path = ['foo.Metadata']

Reply via email to