From: Mihai Moldovan Date: Tue, 29 Sep 2020 16:30:16 +0000 (+0200) Subject: [PATCH] Workaround hawkey test failures with CK_FORK=no. X-Git-Tag: archive/raspbian/0.73.1-3+rpi1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ccc67cbad5722471e02295ed29ebfc3e24467aa6;p=libdnf.git [PATCH] Workaround hawkey test failures with CK_FORK=no. For a description of what is happening here and a rational of why this might just be okay for us, see the source code comment. Gbp-Pq: Name 0008-Workaround-hawkey-test-failures-with-CK_FORK-no.patch --- diff --git a/tests/hawkey/test_goal.cpp b/tests/hawkey/test_goal.cpp index 8ffde63..30f2140 100644 --- a/tests/hawkey/test_goal.cpp +++ b/tests/hawkey/test_goal.cpp @@ -951,6 +951,27 @@ START_TEST(test_goal_upgrade_disabled_repo) auto pool = dnf_sack_get_pool(test_globals.sack); HyGoal goal = hy_goal_create(sack); + /* + * This is probably the weirdest workaround ever, but this test case fails + * with CK_FORK=no (which is used in the valgrind tests) for an unknown + * reason I wasn't able to figure out. + * However, just querying the sack, which should be a read-only operation, + * seems to remedy this problem. + * Since the failure doesn't happen with CK_FORK=yes, whatever is causing + * it is likely not a problem in libdnf/hawkey or the libsolv integration, + * but rather some sort of... stack or heap corruption? Or a side-effect + * of libcheck? + * Given that rationale, it's probably okay to mask the problem with this + * very weird workaround. + */ + HyQuery q = hy_query_create (sack); + hy_query_filter (q, HY_PKG_REPONAME, HY_EQ, HY_SYSTEM_REPO_NAME); + GPtrArray *res = hy_query_run (q); + g_ptr_array_unref (res); + res = NULL; + hy_query_free (q); + q = NULL; + hy_goal_upgrade_all(goal); hy_goal_run_flags(goal, DNF_NONE); int implicitobsoleteusescolors = pool_get_flag(pool, POOL_FLAG_IMPLICITOBSOLETEUSESCOLORS);