Since the 7/12/2013 we have had 6 failures in ImageFieldDisplayTest in 8.x branch testing. The failure mode always seems to be the same.

Drupal core - 8.x fail: https://qa.drupal.org/8.x-status

Overall Summary
==============================================

FAILED: [[SimpleTest]]: [MySQL] 59,165 pass(es), 2 fail(s), and 1 exception(s).

Individual Environment Summaries
==============================================

-- [[SimpleTest]]: [MySQL] --

* Drupal\image\Tests\ImageFieldDisplayTest (131 pass(es), 2 fail(s), and 1 exception(s))
   - [fail] [Completion check] "The test did not complete due to a fatal error." in ImageFieldDisplayTest.php on line 229 of Drupal\image\Tests\ImageFieldDisplayTest->testImageFieldDefaultImage().
   - [fail] [Browser] "POST http://drupalorgqa.ctidigital.com/checkout/admin/structure/types/manage/article/fields/node.article.rnououka/field returned 0 (0 bytes)." in ImageFieldDisplayTest.php on line 251 of Drupal\image\Tests\ImageFieldDisplayTest->testImageFieldDefaultImage().
   - [exception] [Warning] "array_flip(): Can only flip STRING and INTEGER values!array_flip(Array)
Drupal\Core\Entity\FieldableDatabaseStorageController->loadMultiple(Array)
Drupal\Core\Entity\FieldableDatabaseStorageController->load(NULL)
entity_load('file', NULL, )
file_load(NULL)
Drupal\image\Tests\ImageFieldDisplayTest->testImageFieldDefaultImage()
Drupal\simpletest\TestBase->run()
simpletest_script_run_one_test('388', 'Drupal\image\Tests\ImageFieldDisplayTest')
" in FieldableDatabaseStorageController.php on line 212 of Drupal\Core\Entity\FieldableDatabaseStorageController->loadMultiple().
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jthorson’s picture

Looking at the testbot apache logs, I'm seeing a lot of 'Internal Server Error' exceptions, as well as 'table simpletestxxxxxxsemaphore' doesn't exist exceptions.

There's also a 'Call to member function hasPath() on a non-object in views_ui/ViewListController.php line 261', but that one seems familiar and may already have been there for quite some time.

The Internal Server Error messages may be related, but other than that, I don't see anything in the log that might help provide further insight. :(

tim.plunkett’s picture

Project: Drupal core » Drupal.org Testbots
Version: 8.x-dev »
Component: image.module » unexplained test failure

This usually means that the file was not created on disk, so you can't call any methods on it.

Berdir’s picture

The reason that we opened this issue is that this happened ~6 times in the last month on HEAD alone, in the same class, so it is possible that this there is something specific to this test and not a generic testbot problem. N ot sure about moving it over...

Berdir’s picture

Same test fail in https://qa.drupal.org/pifr/test/577203.

I did manage to make this fail once locally in (in 100+ runs), so I don't think it's (only) a testbot problem.

Was not able to see anything that could have gotten wrong, the image field and instance did exist and I was able to save them manually. Now running the tests again with dblog enabled, hoping that I will see some errors there...

jthorson’s picture

Project: Drupal.org Testbots » Drupal core
Version: » 8.x-dev
Component: unexplained test failure » image system

Back to Core as per #4.

Berdir’s picture

damiankloip’s picture

sun’s picture

Correcting issue tag.

@jhodgdon provided extensive test results debugging info including review log in #2191563: Random test failure in ImageFieldDisplayTest

Based on my analysis in that issue, the root cause is definitely WebTestBase::drupalGetTestFiles('image'), but that function does nothing else than to copy some files with static filenames from the Simpletest module directory into the public files directory of the test environment.

After copying, the target directory is scanned again for the copied files. The discovered and returned $files array is empty, which causes the subsequent usage of $file->uri and file_load() to operate on a NULL value.

xjm’s picture

Priority: Major » Critical

HEAD has failed on this one twice this week and numerous times over the past couple months.

catch’s picture

Title: Possible random fail in ImageFieldDisplayTest » Random fail in ImageFieldDisplayTest
alexpott’s picture

Status: Active » Needs review
FileSize
835 bytes
1.21 KB

It's our old friend randomString again! :)

    $alt = $this->randomString(512);
    $title = $this->randomString(1024);
    $edit = array(
      'files[field_settings_default_image_fid]' => drupal_realpath($images[0]->uri),
      'field[settings][default_image][alt]' => $alt,
      'field[settings][default_image][title]' => $title,
    );
    $this->drupalPostForm("admin/structure/types/manage/article/fields/node.article.$field_name/field", $edit, t('Save field settings'));

The post form fails if $alt =

@i&E/v+1"rkADKA0{'6|hZ$qzglH!/|W}NY"kXzGv3=WbN37QDFn|++I9Z/bg[7YZ Wz1`wDLVjN<Ig.\ea SvV^[o;,2"EJbi+k>w9McI#P07y|>p`5RF{#B24oAga(9ns`|ljMK?iLoZ0UT4,PPG4ZNd0^Z7PRnCr!g)A C$29l13eKCA}p=weICM,<@q6oQMd,+oj&teH2p5,1t<%o Dvel-zyJCi1pH/!,kx%J!O'WH$-hm$:@XRpeEP`!E1Hz X=u}$b#UqIDg?wV>rv%|FypHXe_"\[m$*3fsCbCtaVEO>HAy98`g, 0bQ<Ij(`Oqf71q]bmy'n]"P>O?:H{'cF[TB{YzT2I;b2.Q>NM3lFD^'*-c_&\u $<Ia'g$A}JVp[.+zN*d]X#a\<PfnohEf}F^UX*,hVPA.)^@>6?G::bDb7oTACv <TOcQ=+l+S"}XZ\~0lU3hB++^Vu'e;p(B(_A3A"OJ*]&lt):[9*B.AG[wc3NXb-\Kp?5R_Up`

This is being caused by strings starting with an @ and curl post - if you test this manually there is no issue. I think it has something to do with how file uploads work - see http://uk1.php.net/curl_setopt - specifically CURLOPT_POSTFIELDS.

Patches attached to prove failure mode and a very simple fix.

alexpott’s picture

FileSize
1.29 KB
1.01 KB

A slightly better patch.

The last submitted patch, 11: 2174997.11.will-fail.patch, failed testing.

Berdir’s picture

Status: Needs review » Reviewed & tested by the community

Welcome to episode #57 of "How randomString() is messing with our tests."

Nice find, fix looks good.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.