[IMP] reporting if creating template DB fails

Before this, if creating the DB failed the next worker would find
themselves with an empty `template-` file, so they would take the path
to *create* a template database, which would fail when trying to
`mkdir` the `shared-` directory as the directory would already exist.

The problem with this is this module would likely immediately fail and
take down their worker, triggering a test suite failure for themselves
and likely hiding the *true* failure cause (not sure why the
originally failed worker isn't the first one to trigger a failure but
there you go).

By skipping the tests instead, we provide a lot more opportunity for
the "true" failure to be revealed.
This commit is contained in:
Xavier Morel 2024-11-20 12:43:43 +01:00
parent bf20127da9
commit bf4cc09aa4

View File

@ -331,7 +331,11 @@ class DbDict(dict):
return db
d = (self._shared_dir / f'shared-{module}')
d.mkdir()
try:
d.mkdir()
except FileExistsError:
pytest.skip(f"found shared dir for {module}, database creation has likely failed")
self[module] = db = 'template_%s' % uuid.uuid4()
subprocess.run([
'odoo', '--no-http',