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
Drupal\KernelTests\Core\Entity\CreateSampleEntityTest::testSampleValueContentEntity can randomly fail.
There was 1 failure:
1) Drupal\KernelTests\Core\Entity\CreateSampleEntityTest::testSampleValueContentEntity
Failed asserting that actual size 1 matches expected size 0.
/var/www/html/core/tests/Drupal/KernelTests/Core/Entity/CreateSampleEntityTest.php:81
https://www.drupal.org/pift-ci-job/1425347
https://www.drupal.org/pift-ci-job/1425317
https://www.drupal.org/pift-ci-job/1422878
77 // Create sample entities without bundles.
78 else {
79 $entity = $this->entityTypeManager->getStorage($entity_type_id)->createWithSampleValues(FALSE, $values);
80 $violations = $entity->validate();
81 $this->assertCount(0, $violations);
82 if ($label) {
83 $this->assertEquals($title, $entity->label());
84 }
}
Comment | File | Size | Author |
---|---|---|---|
#9 | 3086001-9.patch | 737 bytes | alexpott |
#9 | 3086001-9.test.patch | 2.96 KB | alexpott |
| |||
#7 | 3086001-6.test-only.patch | 3.41 KB | alexpott |
#4 | 3086001-4-test-only-repeat-500.patch | 3.01 KB | Krzysztof Domański |
#3 | 3086001-3-test-only-repeat-500.patch | 3.01 KB | Krzysztof Domański |
Comments
Comment #1
Krzysztof DomańskiKrzysztof Domański created an issue. See original summary.
Comment #2
Krzysztof DomańskiComment #3
Krzysztof DomańskiDebugging...
Sometimes the
$values
are an empty array.Comment #4
Krzysztof DomańskiDebugging
$entity_type_id
.This is
"path_alias"
.Comment #5
plachAnother instance: https://www.drupal.org/pift-ci-job/1428851
Comment #6
plachRandom test failures are usually critical.
Comment #7
alexpottLet's see what the violation actually is.
Comment #9
alexpottHere's a fix. It's happening because occasionally we generate a string 255 chars long and then add a character to it :)
Comment #10
plachLooks good!
Comment #12
catchCommitted b541e05 and pushed to 8.8.x. Thanks!
Comment #14
xjm