Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up to #2095771: alexpott's test issue
Helper issue for patches I'm working on
Comments
Comment #2
alexpottComment #3
alexpottComment #14
alexpottComment #22
alexpottComment #29
alexpottComment #31
mikeryanComment #32
mikeryanComment #33
lokapujyaHow do you view the HTML? Just run this patch locally?
Comment #35
alexpott@lokapujya so things are base64_encode(gzcompress())... so you need to do the opposite... gzuncompress(base64_decode())... the patch in #29 using this you'll get the watchdog table after a random fail in the test output.
Comment #36
mikeryanBotched the last patch, this one removes the trait name change.
Comment #37
mikeryanJust one of those mornings...
Comment #39
mikeryanOK, so the last patch was missing the instrumentation I meant to add, and it didn't work anyway, so now testing locally *this* one will actually log the start of each migration process to watchdog...
Comment #40
mikeryanQueued with various PHP/db combos - maybe there's some combo that's more likely to hit the failure (or even one that's reproducible...).
Comment #45
mikeryanSo, somehow, d7_comment_entity_form_display is busy the first time it is attempted... The two runs of d7_comment_entity_form_display_subject must be related, but I don't see how we get in this state.
Comment #46
mikeryanMore instrumentation (capturing the setting of the status). Also, since we see d7_comment_entity_form_display_subject executing first in the failures, but in my local successes I see d7_comment_entity_form_display execute first, setting a dependency to see if that triggers more consistent failures.
Comment #53
mikeryanOops - using dblog (a requirement of migrate_drupal_ui but not of migrate) in migrate broke the other tests. And also making the migration dependency required broke a test, making that optional now...
Comment #56
mikeryanVery interesting - now d6_upload is the busy one (in both the test failures). The sequence of events (where a status of 1 is IMPORTING and 0 is IDLE):
Immediately before d6_upload, this is what a normal migration looks like:
Starting the upload migration:
Here's where we break - d6_upload did not complete in a normal way, and we're picking up from d6_upload_entity_display again:
And onward without further event:
So, it seems some non-catchable event occurs while d6_upload is running, and a new batch is started with $context['sandbox']['migration_ids'] set back to where it was before d6_upload_entity_display completed. I have to wonder how batch API works in the test environment - is there some timeout happening that forcefully aborts one page of the batch and restarts with the last recorded sandbox?
Comment #57
mikeryanBetcha this one fails consistently - not even going to queue up 6 copies this time...
Comment #58
mikeryanHeh, this very problem is blocking the test running...
Anyway, it's looking to me like the root problem isn't anything in migration code, it's simply the length of time the upgrade test takes.
Comment #59
mikeryanAdding the sleep(10) got me my first local failure, thought it would be a slamdunk to reproduce here - queued up a few more tests, let's see what our hit ratio is.
Comment #60
alexpottComment #61
alexpottSo lets try this...
Comment #64
alexpottLet's go for something silly.
Comment #68
alexpottReverting #2694391: Separate cache bin for migrations - think this is the root cause.
Comment #69
alexpottComment #70
alexpottOops patch in #68 had the 1 second code too.
Comment #71
alexpottReverted #2694391: Separate cache bin for migrations