Skip to content

Failing tests when packaging for Arch Linux #2250

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

Open
jelly opened this issue May 18, 2025 · 3 comments
Open

Failing tests when packaging for Arch Linux #2250

jelly opened this issue May 18, 2025 · 3 comments
Labels
good first issue Involves straightforward changes to the codebase; well-suited for first-time contributors Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@jelly
Copy link

jelly commented May 18, 2025

I'm trying to update our package to 5.2.13.1 from 5.2.12.0 and ctest now errors out with three test failures. They also occur on 5.2.13.0

FAIL: test_missing_setup_goal_resolve (base.test_goal.TestGoal.test_missing_setup_goal_resolve)
----------------------------------------------------------------------
libdnf5.exception.UserAssertionError: /usr/src/debug/dnf5/dnf5-5.2.13.1/libdnf5/base/goal.cpp:3112: libdnf5::base::Transaction libdnf5::Goal::resolve(): API Assertion 'p_impl->base->is_initial
ized()' failed: Base instance was not fully initialized by Base::setup()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/dnf5/src/dnf5-5.2.13.1/test/python3/libdnf5/base/test_goal.py", line 34, in test_missing_setup_goal_resolve
    with self.assertRaisesRegex(libdnf5.exception.UserAssertionError,
         ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                '^libdnf5/base/goal.cpp:[0-9]+:.*libdnf5::Goal::resolve\\(\\):'
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                ' API Assertion \'p_impl->base->is_initialized\\(\\)\' failed:'
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                ' Base instance was not fully initialized by Base::setup\\(\\)'):
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: "^libdnf5/base/goal.cpp:[0-9]+:.*libdnf5::Goal::resolve\(\): API Assertion 'p_impl->base->is_initialized\(\)' failed: Base instance was not fully initialized by Base::setup\(\)
" does not match "/usr/src/debug/dnf5/dnf5-5.2.13.1/libdnf5/base/goal.cpp:3112: libdnf5::base::Transaction libdnf5::Goal::resolve(): API Assertion 'p_impl->base->is_initialized()' failed: Base
 instance was not fully initialized by Base::setup()"

======================================================================
FAIL: test_writing_to_locked_option (conf.test_option.TestConfigurationOptions.test_writing_to_locked_option)
----------------------------------------------------------------------
libdnf5.exception.UserAssertionError: /usr/src/debug/dnf5/dnf5-5.2.13.0/libdnf5/conf/option.cpp:66: void libdnf5::Option::assert_not_locked() const: API Assertion '!p_impl->locked' failed: Att
empting to write to a locked option:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/dnf5/src/dnf5-5.2.13.0/test/python3/libdnf5/conf/test_option.py", line 75, in test_writing_to_locked_option
    with self.assertRaisesRegex(libdnf5.exception.UserAssertionError,
         ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                '^libdnf5/conf/option.cpp:[0-9]+: void libdnf5::Option::assert_not_locked\\(\\) const:'
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                ' API Assertion \'!p_impl->locked\' failed:'
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                ' Attempting to write to a locked option'):
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: "^libdnf5/conf/option.cpp:[0-9]+: void libdnf5::Option::assert_not_locked\(\) const: API Assertion '!p_impl->locked' failed: Attempting to write to a locked option" does not ma
tch "/usr/src/debug/dnf5/dnf5-5.2.13.0/libdnf5/conf/option.cpp:66: void libdnf5::Option::assert_not_locked() const: API Assertion '!p_impl->locked' failed: Attempting to write to a locked opti
on: "

======================================================================
FAIL: test_creating_global_logger_again (logger.test_global_logger.TestGlobalLogger.test_creating_global_logger_again)
----------------------------------------------------------------------
libdnf5.exception.UserAssertionError: /usr/src/debug/dnf5/dnf5-5.2.13.0/libdnf5/logger/global_logger.cpp:33: libdnf5::GlobalLogger::GlobalLogger(): API Assertion 'librepo_logger == nullptr' failed: Only one GlobalLogger can exist at a time

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/build/dnf5/src/dnf5-5.2.13.0/test/python3/libdnf5/logger/test_global_logger.py", line 29, in test_creating_global_logger_again
    with self.assertRaisesRegex(libdnf5.exception.UserAssertionError,
         ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                '^libdnf5/logger/global_logger.cpp:[0-9]+: libdnf5::GlobalLogger::GlobalLogger\\(\\):'
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                ' API Assertion \'librepo_logger == nullptr\' failed:'
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                ' Only one GlobalLogger can exist at a time'):
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: "^libdnf5/logger/global_logger.cpp:[0-9]+: libdnf5::GlobalLogger::GlobalLogger\(\): API Assertion 'librepo_logger == nullptr' failed: Only one GlobalLogger can exist at a time" does not match "/usr/src/debug/dnf5/dnf5-5.2.13.0/libdnf5/logger/global_logger.cpp:33: libdnf5::GlobalLogger::GlobalLogger(): API Assertion 'librepo_logger == nullptr' failed: Only one GlobalLogger can exist at a time"
@kontura
Copy link
Contributor

kontura commented May 26, 2025

I don't think we have changed this recently. I guess it is caused by a change how the package is build.
It comes down to the value of __FILE__ macro which might depend on how the source files are passed to the compiler.
It looks like you pass the files with absolute path but our tests expect relative source paths.

We probably could remove the leading ^ from the expected regexes which should fix it for you.

@kontura kontura added Priority: MEDIUM good first issue Involves straightforward changes to the codebase; well-suited for first-time contributors Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take labels May 26, 2025
@jelly
Copy link
Author

jelly commented May 27, 2025

Thanks for the hint, I've written this patch and now the tests succeed. Happy to send a PR if this is wanted.

@kontura
Copy link
Contributor

kontura commented May 29, 2025

I think the PR would be nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Involves straightforward changes to the codebase; well-suited for first-time contributors Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
None yet
Development

No branches or pull requests

2 participants