diff --git a/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ChangedTestItem.php b/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ChangedTestItem.php index 1425588..770f222 100644 --- a/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ChangedTestItem.php +++ b/core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/ChangedTestItem.php @@ -31,7 +31,12 @@ public function preSave() { // During a test the request time is immutable. To allow tests of the // algorithm of // Drupal\Core\Field\Plugin\Field\FieldType\ChangedItem::preSave() we need - // to set a real time value here. + // to set a real time value here. But for the stability of the test, + // change the entity with the original language at the beginning of the + // second. Comply with this requirement on real sites do not need to. + if ($this->getEntity()->language()->isDefault()) { + time_sleep_until ( time() + 1 ); + } $this->value = time(); } }