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.
The automatic test FileFieldValidateTestCase fail random..
In some patch that don't touch in FileField, or only in javascript, that nothing related with filefield have to be re-tested because the simpletest fail in FileFieldValidateTestCase
Error message:
FileFieldValidateTestCase 101 1 7
Message Group Filename Line Function Status
array_flip(): Can only flip STRING and INTEGER values! Warning entity.inc 108 DrupalDefaultEntityController->load()
Trying to get property of non-object Notice file.test 374 FileFieldValidateTestCase->testRequired()
Undefined property: stdClass::$uri Notice file.test 146 FileFieldTestCase->assertFileExists()
File exists after uploading to the required multiple value field. Other file.test 375 FileFieldValidateTestCase->testRequired()
Undefined property: stdClass::$fid Notice file.test 154 FileFieldTestCase->assertFileEntryExists()
array_flip(): Can only flip STRING and INTEGER values! Warning entity.inc 108 DrupalDefaultEntityController->load()
Trying to get property of non-object Notice file.test 156 FileFieldTestCase->assertFileEntryExists()
Undefined property: stdClass::$uri Notice file.test 156 FileFieldTestCase->assertFileEntryExists()
Comments
Comment #1
int CreditAttribution: int commentedLike:
http://qa.drupal.org/pifr/test/22976
http://qa.drupal.org/pifr/test/23248
http://qa.drupal.org/pifr/test/23258
http://qa.drupal.org/pifr/test/23282
http://qa.drupal.org/pifr/test/23286
http://drupal.org/node/582622#comment-2405160
Two testing servers and one give OK in testing HEAD, and other no.
http://qa.drupal.org/pifr/test/32
http://qa.drupal.org/pifr/test/33
Comment #2
int CreditAttribution: int commentedComment #3
int CreditAttribution: int commentedI don't know if this is true, but automatic test should never be created with random content. The automatic test should be reproduced, exacly the same variables.
e.g. Instead be one variable with random content, should be 3 variables with static content, with that 3 variables with almost possible text.
Comment #4
Dave ReidTest bot has been disabled until we can figure this out.
http://qa.drupal.org/node/68
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedsubscribe. nasty stuff.
Comment #6
sunAlso investigated this today... I ran this test multiple times on my local machine (Windows), always passed 100%. AFAICS, the test does not seem to do anything scary.
What I didn't test is running tests in concurrency. Did anyone try this?
Comment #7
arhak CreditAttribution: arhak commentedalso http://qa.drupal.org/pifr/test/23068
and a different failure is at http://qa.drupal.org/pifr/test/23044 (my own patch not related with FileField at all)
this case HAD (because now it passed) 2 fails and 14 exceptions, which might help to alight the issue
- 1 fail was "File exists after uploading to the required multiple value field." with 7 exception around like the other tests failing
- the other fail was similar but for for the single value field (also with 7 exceptions around it, the same exception's messages it got for the multiple value field)
Comment #8
Damien Tournoud CreditAttribution: Damien Tournoud commentedThe probable culprit is FileFieldRevisionTestCase::testRevisions(). Files are shared between the test instances, and this test actually physically removes files.
The only correct fix is to copy all the test files to the new files directory in DrupalWebTestCase::setUp().
Comment #9
Damien Tournoud CreditAttribution: Damien Tournoud commentedIf I'm right, this should fix it.
Comment #10
Anonymous (not verified) CreditAttribution: Anonymous commentedfrom #drupal:
(16:56:04) beejeebus: anyone got any clues about reproducing that?
(17:17:07) DamZ: beejeebus: I think I know what's going on
(17:17:33) DamZ: beejeebus: it's probable that FileFieldRevisionTestCase::testRevisions() is running at the same time as the failing one
(17:18:07) DamZ: beejeebus: the files are shared, and FileFieldRevisionTestCase::testRevisions() is removing the file needed by FileFieldValidateTestCase
(17:55:13) beejeebus: DamZ: oh, its a concurrency issue?
(17:56:10) DamZ: beejeebus: yeah, of course
(17:56:58) beejeebus: DamZ: oh, that should be easy to fix then
Comment #11
Damien Tournoud CreditAttribution: Damien Tournoud commentedWhy changing the status?
Comment #12
cburschkaThis is fairly ironic - unpatched filefield works fine for me, but the patched version runs into the similar errors as the test server.
Note the memory size failure claiming a memory limit of 64M, when the memory limit is actually set to 128M. This is unusual...
Comment #13
Damien Tournoud CreditAttribution: Damien Tournoud commentedNice catch! I forgot to reset the copiedTestFiles indicator, so when several tests of the same class are run, files are only copied the first time.
This actually proves that the random errors in the test bot are actually due to a missing file.
Comment #14
cburschkaI can run the FileFieldValidateTestCase class with 102 passes and 0 fails, but I am not convinced the test completes, because there are three occurrences of
Oddly, these failures do not get counted. Multiple different checks show that PHP's memory limit is set to 256M (and in fact any deliberately induced crashes elsewhere show a limit of 256MB was exceeded). This is weird.
Comment #15
cburschkaOkay, so here's what happens.
I have this file in the folder for whatever reason:
It contains this:
I've cleaned out and reinstalled my site now and hope that the error goes away.
Edit:
All is well. 102 passes, no failures, no exceptions, and the phantom fails are gone.
Comment #16
bleen CreditAttribution: bleen commentedsuperscribe
Comment #17
cburschkaNote that this is no longer the only test case that fails right now: #654854: Clean up conditions in comment_reply(), avoid node_view() when unnecessary.
Comment #18
bleen CreditAttribution: bleen commented@Arancaytar
#658314: $page variable in node.tpl.php is buggy
Comment #19
Damien Tournoud CreditAttribution: Damien Tournoud commentedIn fact, there is no reason to pregenerate the files. The generation is fairly quick and those files are only used in a couple of tests. So I suggest we simply remove the pregeneration and generate the test files on-demand, the first time
DrupalWebTestCase::drupalGetTestFiles()
is called.This should be more robust, and would avoid Arancaytar's issue where a phantom error.log was copied over and over to the new test environment.
Comment #20
int CreditAttribution: int commentedWe should commit the #19 path, or remove the breaking test. The testbot can't be so long stopped.
Comment #21
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Bring back the testbots p-uh-lease! Thanks DamZ.
Comment #22
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis should fix the remaining test failures. Some tests were doing unholy things with the test files.
Comment #23
int CreditAttribution: int commentedhttp://qa.drupal.org/pifr/test/32
Fail:
FileScanDirectoryTest (Found two, expected javascript files.)
ImageEffectsUnitTest (Division by zero)
ImageToolkitUnitTest (Division by zero)
Comment #24
int CreditAttribution: int commentedcross post
Comment #25
cburschkaCross-post.
Comment #26
Damien Tournoud CreditAttribution: Damien Tournoud commentedI ran the tests manually on qa-1 (my test slave). 100% pass.
Comment #27
Dries CreditAttribution: Dries commentedCommitted the patch in #22. Good thing we're making progress. Thanks @DamZ. :)
Comment #28
int CreditAttribution: int commentedFixed issues should not be tested. should be automaticly removed from the queue.
Comment #29
bleen CreditAttribution: bleen commentedI believe that this error is still occurring but now with "FieldInfoTestCase" ...
the patch in comment #3 of #658148: The "access user profiles" permission is poorly named is nothing more then a find/replace on the string "access user profiles" but it is failing inexplicably on "FieldInfoTestCase"
I'm not 100% certain, but I suspect that its related to this issue ... thoughts?
Comment #30
int CreditAttribution: int commentedYou have to find more 2 or 3 test fails like this..
But actualy is true, because the first test give the error, but re-tested don't give none.. But I don't find any issue with this problem
Comment #31
int CreditAttribution: int commentedsee this #669842: qa.drupal.org #32 is re-testing and re-testing over and over again, without ask for it
Comment #32
cburschkaThe error doesn't appear to be happening anymore. Even if it is, this would be an unrelated error because FieldInfoTestCase is not copying any files anywhere.
If a non-file-copying tests is failing erratically again, let's open a new issue.