-
Notifications
You must be signed in to change notification settings - Fork 40
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
Fixed: Functional tests: LayoutUpgradePathTest fails too often in GHA. #6293
Comments
Elaborating on where the error occurs, test failures look like this: With the first error being:
Line 14 of function dashboard_menu() {
$items = array();
// Check if any dashboard is present and is not disabled.
$dashboard_layouts = layout_load_multiple_by_path('admin/dashboard'); // <-- Line 14
...
} A guess as to what might be happening here: The old Drupal 7 Now why |
|
Maybe, the easier way to fix this is for |
(Notice that the Dashboard module does not list the Layout module as its dependency, but that is understandable: Differently, upgrading from Drupal 7 would probably be not possible, as the Drupal 7 Dashboard module does not depend on the Layout module, but the Block module.) |
At least, that's easy to explain: the Layout module in B is required, it can't be off. So there's no need to declare a dependency. |
It is required from the Standard profile, but other profiles could not require it. |
@klonos this does shed a light on it, though. Hopefully... Your test fails with:
^^ And that's a Drupal path. The Backdrop path would be So function system_block_view() tries to include a Drupal file. 🤔 |
@kiamlaluno it's not the profile, but the module is defined as required by its info file. You don't even see the Layout module on /admin/modules/list, which is the case for all required modules. |
@indigoxela I believe that the |
It's actually the GitHub Action runner, the dir is always /home/runner/work/backdrop/backdrop. (Tugboat is unrelated here.) But it's still the wrong path - no "**/core/**modules..." but "/modules..." as in Drupal 7. |
Yeah, I don't know why that happens 🤷🏼 |
It is also an explicit dependency of the Standard profile and the Testing profile. Anyway, what I was trying to say is that, during a migration from Drupal 7 (which is what the |
A little more brainstorming... we're supposed to be on It's there since 2019 though, and it's not clear why this suddenly would triggers random errors on different PHP versions. And most of all: I ran this test locally in several combinations and it always passes. |
Wondering if there is a way to see the verbose output of the automated tests in Github? When I run tests locally, I get lots of output that includes the pages that include the data sent to the server via POST, and all server responses to requests. This has helped me a great deal in the past. But I don't seem to be able to see that output in GHA. |
The code in core/update.php that verifies the Dashboard is enabled is the following one. function update_helpful_links() {
$links['front'] = array(
'title' => t('Home page'),
'href' => '<front>',
);
if (module_exists('dashboard') && user_access('access dashboard')) {
$links['dashboard'] = array(
'title' => t('Dashboard'),
'href' => 'admin/dashboard',
);
}
elseif (user_access('access administration pages')) {
$links['admin-pages'] = array(
'title' => t('Administration pages'),
'href' => 'admin',
);
}
if (user_access('administer site configuration')) {
$links['status-report'] = array(
'title' => t('Status report'),
'href' => 'admin/reports/status',
);
}
return $links;
} I guess that, at some point, for some reason, there is code that invokes |
Just tried a totally different approach: run an upgrade from a D7 site that had the dashboard module enabled (never did that before, as that module was always off). Hm, doesn't throw an error, but doesn't actually work, either. After upgrading, the module shows as enabled, but neither the dashboard layout exists, nor does the functionality work after importing a vanilla dashboard layout. Why I tried that? Eventually the test fails, because something's actually broken in that specific part of the upgrade. 😉 Just in case... |
For those that cannot reproduce this on their local: crazy thought, but are you using apache (which is what our tests are using) or nginx? |
...also, more recently I've been having both
|
@klonos good idea, but unfortunately my dev setup is comparable to the GHA setup. Apache + php-fpm. The problem never shows on my dev, but I never run all the tests, as my dev box just isn't powerful enough for that. I'm afraid it's a problem caused by some race condition. We added some functional tests recently, so the order of tests run in batches changed. |
FTR: the order of calling functions is:
So flushing the cashes triggers menu_rebuild, which triggers hook_menu. Fancy, that this doesn't actually always fail, as the upgrade tests try to get rid of all caches (also static caches). But they never fail on my local dev. So, no update here, still unsolvable. |
This is going to be a real forehead smacker if my wild guess at backdrop/backdrop#4669 actually fixes this problem. While working on #2557, I was moving config functions around to be super-early bootstrap, and I got a clear set of errors that dashboard.module couldn't find the So the fix? Maybe we just explicitly declare Dashboard module to depend on Layout module? Could it be so easy? I re-ran the tests 3 times on backdrop/backdrop#4669 with perfect 100% passing every time across all PHP versions. I also got 100% passing a few times on my PR for #2557, which also had the same fix. I'm going to keep running it a few times more and see if continues passing every time. 🤞 |
What the... 🤯 @kiamlaluno already suggested it, but I've been too stubborn to seriously consider (shame on me!). A one-liner fix. 🥇 |
It's now passed 100% 4 more times. There's zero-harm in trying out this fix. I think we should merge it and just see if it fixes the problem. |
Agreed -- and merged into Thanks @quicksketch, @kiamlaluno, @indigoxela, @klonos, and @argiepiano for all the brainpower that went into this one liner! Fingers are now crossed. |
Thanks folks! And sorry I didn't consider this sooner considering @kiamlaluno's suggestions earlier. Honestly, I'm surprised that just specifying the dependency would be sufficient, but it seems to have done the job. |
Description of the bug
Yet another failure of LayoutUpgradePathTest. In two different PHP versions. In a PR, that doesn't even touch PHP-code.
This tests fails too often, to call it "occasional". Not always the same PHP version, not all PHP versions at once, but way too often to ignore.
The test chokes with:
Call to undefined function layout_load_multiple_by_path()
(ships with layout.module).Steps To Reproduce
No idea, the test passes locally, of course.
Some race condition of update hooks, when upgrading? Doesn't seem reasonable, as the Layout module gets enabled in system_update_1000().
Additional information
The text was updated successfully, but these errors were encountered: