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.
Problem/Motivation
Possible random fail in #2416763-16: Convert Url::fromUri() base:// scheme to base:
85,186 pass(es), 1 fail(s), and 1 exception(s)
Non-pass
Test name Pass Fail Exception
CollapsedDrupal\migrate_drupal\Tests\d6\MigrateFileTest 7 1 1
Message Group Filename Line Function Status
copy(/tmp/some-temp-file.jpg): failed to open stream: No such file or directorycopy('/tmp/some-temp-file.jpg', 'temporary://some-temp-file.jpg') Drupal\migrate\Plugin\migrate\destination\EntityFile->import(Object, Array) Drupal\migrate\MigrateExecutable->import() Drupal\migrate_drupal\Tests\d6\MigrateFileTest->setUp() Drupal\simpletest\TestBase->run(Array) simpletest_script_run_one_test('589', 'Drupal\migrate_drupal\Tests\d6\MigrateFileTest') Warning EntityFile.php 81 Drupal\migrate\Plugin\migrate\destination\EntityFile->import()
File /tmp/some-temp-file.jpg could not be copied to temporary://some-temp-file.jpg. migrate MigrateTestBase.php 141 Drupal\migrate\Tests\MigrateTestBase->display()
Proposed resolution
Remaining tasks
User interface changes
API changes
Comment | File | Size | Author |
---|---|---|---|
#21 | 2417549.21.patch | 6.66 KB | alexpott |
#21 | 19-21-interdiff.txt | 570 bytes | alexpott |
#19 | 2417549.18.patch | 6.55 KB | alexpott |
#19 | 16-18-interdiff.txt | 7.1 KB | alexpott |
#16 | 2417549.16.patch | 6.22 KB | alexpott |
Comments
Comment #1
xjmI was able to reproduce this failure locally with the patch applied once, but not thereafter.
Comment #2
xjmPostponing pending it being reproduced again.
Comment #3
aspilicious CreditAttribution: aspilicious commentedHad it twice today when uploading patches.
Comment #4
Mile23#2417923: Migrate Tests Fail Consistently when run through UI
Comment #5
pwolanin CreditAttribution: pwolanin commentedI've not seen this on any patches - can close as outdated?
Comment #6
xjm@pwolanin, no, because @aspilicious confirmed seeing it.
@aspilicious, can you link the test results where you got the failure?
Comment #7
xjmComment #8
mihai7221 CreditAttribution: mihai7221 commentedHere is a test with this failure: https://qa.drupal.org/pifr/test/969373
Comment #9
BerdirWe run all migrate tests twice. if this is creating a file with a static name in the global temporary file system (the error looks like it), is it possible that we run the same test code twice at the same time, and then they get in the way of each other?
Comment #10
znerol CreditAttribution: znerol commentedAnother one: https://qa.drupal.org/pifr/test/1020778
Comment #11
znerol CreditAttribution: znerol commentedI can reproduce it sometimes with
HEAD
and./core/scripts/run-tests.sh --concurrency 8 [...] migrate_drupal
.Why does
MigrateFileTest::setUp()
alters$this->tempFilesDirectory
in the first place? It is set to a per-test directory by the base test class for isolation purposes.Comment #12
znerol CreditAttribution: znerol commentedComment #13
benjy CreditAttribution: benjy at CodeDrop commentedI think it needs to match up with the values in the d6 database as well. I think our long term solution to this was to move the tests into unit tests for the file destinations.
Comment #14
alexpottA different approach - I can not get MigrateFileTest to pass locally without moving the file creation above
$executable->import();
. I think think the only reason HEAD is passing is that MigrateDrupal6Test is running before MigrateFileTest.Comment #15
alexpottBtw the only reason #12 passed is because the testbot that ran the test already has
/tmp/some-temp-file.jpg
existing from a previous test run :P.Comment #16
alexpottThis is a confirmed random test fail and should be critical. Discussed with @benjy in IRC and he pointed out that we should not be altering the dumps. Therefore we need to come up with a way of altering stuff once the dumps have loaded. The patch attached introduces two new interfaces to allow migrate tests to alter dumps and react to a tear down so that we don;t have to hack stuff into MigrateFullDrupalTestBase tests. The interfaces are:
MigrateDumpAlterInterface
MigrateTearDownInterface
Comment #17
benjy CreditAttribution: benjy at CodeDrop commentedIf we put the file into $this->tempFilesDirectory rather than /tmp and updated the database accordingly could we avoid the tear down stuff altogether?
I think we'd also need to update file_temporary_path for that to work.
Comment #18
xjmComment #19
alexpott@benjy good idea.
Comment #20
benjy CreditAttribution: benjy at CodeDrop commentedLooks great, thanks for fixing this!
Comment #21
alexpottFixed missing comment.
Comment #22
webchickLooks like a much more robust solution. Thanks a lot for tracking this down!
Looks like migrate lead signed off, so...
Committed and pushed to 8.0.x. Thanks!
Comment #23
webchickComment #26
webchickYes, yes...