Closed (fixed)
Project:
Automatic Updates
Version:
3.0.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
3 Feb 2023 at 04:11 UTC
Updated:
28 Mar 2023 at 14:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tedbowjust hit this again https://www.drupal.org/pift-ci-job/2586929
re-running tests made it pass
Comment #3
tedbowComment #4
wim leers💯
Comment #5
omkar.podey commentedComment #7
tedbow@omkar.podey thanks I think that is about 5 fails out of 100 https://dispatcher.drupalci.org/job/drupal8_contrib_patches/143858/console
Not good 😔
Comment #8
omkar.podey commentedIt did fail randomly the error i can see is while
$this->inspector->getConfig('minimum-stability', $dir);and some how we getPHPas a value.Attached a screenshot below

Comment #9
omkar.podey commentedNow i'm wondering if the changes i pulled from 8.x-2.xis making it consistently pass, probably because of
($type === ProcessOutputCallbackInterface::OUT)the type checkComment #10
omkar.podey commentedThis proves that with the changes from 8.x-2.x the tests are consistently passing, we can see different errors before and after merge (both cases without the check
($type === ProcessOutputCallbackInterface::OUT))Comment #11
omkar.podey commentedComment #12
omkar.podey commentedThe conclusion for now,
Comment #13
omkar.podey commentedComment #14
tedbowComment #15
yash.rode commentedI got this error on #3343889-17: Drop support for end-of-life versions of Composer on DrupalCI while I was not able to reproduce it on my local, re-running the test solved it for me.
Comment #16
wim leersYep — all you can do for now is re-running it. That's why it's a random failure!
Comment #17
wim leersPer https://stackoverflow.com/a/57381161 this is perhaps happening because DrupalCI's
/tmpis full? 🤔Also: AFAICT this started happening since #3328234: Improve test DX *and* confidence: stop using VFS.
Comment #20
wim leersClosed the
8.x-2.xMR in favor of a new3.0.xone. Moved all changes.And then added more debug output.
Comment #21
wim leersyet…
Does that mean we can fix this by simply doing
ini_set('sys_temp_dir', $some_directory_we_created)? 🤔Comment #22
tedbowComment #23
omkar.podey commentedthe problem might be with the permissions
chmod 1777 the_tmp_directorymight workComment #24
omkar.podey commentedthe open_base_dir is also empty
open_basedir => no value => no valueso just creatingmkdir /var/www/tmpand changing permissionschmod 1777 /var/www/tmpmaybe needssudo?Comment #25
omkar.podey commentedRetesting to see if it actually helped or was just a fluke
Comment #26
omkar.podey commentedThe tmp directory in not getting set
Comment #27
wim leersThis is now hypercritical. The failure frequency is higher. Probably because we run more
composercommands now.Comment #28
wim leersI guess it makes sense that calling
ini_set('sys_temp_dir', …)does not help because the error message is occurring insidecomposer's\Composer\Console\Application::doRun():— I bet that this is happening because we run tests with a high level of concurrency on DrupalCI, and that would make it _feasible_ that
sys_get_temp_dir() . '/temp-' . md5(microtime());runs at the exact same time in concurrent tests ⇒ a race condition!Comment #29
wim leers👆 #28 means that #3345222 would help a LOT (but still would not solve it entirely): #3345222-4: Optimize Composer calls in FixtureManipulator.
Comment #30
wim leers🕵️♀️ The Composer code quoted in #28 was added in https://github.com/composer/composer/commit/28e9193e9ebde743c19f334a7294... almost 7 years ago. It was refined a few days later in https://github.com/composer/composer/commit/43eb471ec293822d377b618a4a14... and it's remained the same since then (other than non-semantical changes).
Comment #31
wim leersWe could ask Composer to adopt
hrtime()(TIL!) instead, that would make the chances of a collision far lower (microseconds vs nanoseconds).But that will take time, which we don't have.
What if we can at runtime configure a unique temp dir? A quick experiment with a
test.inifile like this:yields
🥳
Comment #32
wim leersWell I was very pleasantly surprised to discover
\Drupal\package_manager\ProcessFactory— without that we might have had to makecomposer-stagermodify its\PhpTuf\ComposerStager\Infrastructure\Service\ProcessRunner\AbstractRunner! 😅Let's see how this fares… 🤓
Comment #33
wim leersSo apparently
tmpdiris not considered a word 🙄Comment #34
wim leersWhile there is an ~80% failure rate today in kernel tests (in the sense that a test run is very likely to have at least one kernel test fail with the error in this issue's title), this one immediately passed … so … that suggests that #3 actually fixes this 😄
Queuing a second one to confirm… but I'm optimistic! 😄
I will land this without review from others because pretty much everyone reported being constantly blocked by this. Plus, the changes are very isolated, trivial to revert!
Comment #36
wim leersYep, another all-green
Kerneltest suite run!But … build & functional tests failed hard:
I think that's easy to fix though 🤞
Comment #37
phenaproximaDue to the agreed hypercriticality (!) of this issue, I'm okay merging whatever fixes it post-haste without review. Consider this a "blanket RTBC".
Comment #38
wim leersThat did it! 🥳
Comment #40
wim leersBoth green, committed! 🚢
Comment #42
wim leersNow filed upstream PR with Composer to hopefully get it fixed there: https://github.com/composer/composer/pull/11375 🤞