diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
index 11b79b3..fae7943 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDefinitionUpdateTest.php
@@ -441,7 +441,10 @@ public function testBaseFieldDeleteWithExistingData() {
       'delta' => '0',
       'new_base_field_value' => $entity->new_base_field->value,
     ];
-    $this->assertSame($expected, (array) $result[0]);
+    $actual = (array) $result[0];
+    // Sort the expected and actual array by key before asserting, to prevent
+    // that a different sequence of the columns in the table affect the check.
+    $this->assertSame(ksort($expected), ksort($actual));
 
     // Check that the field storage definition is marked for purging.
     $deleted_storage_definitions = \Drupal::service('entity_field.deleted_fields_repository')->getFieldStorageDefinitions();
@@ -508,7 +511,10 @@ public function testBundleFieldDeleteWithExistingData() {
       'delta' => '0',
       'new_bundle_field_value' => $entity->new_bundle_field->value,
     ];
-    $this->assertSame($expected, (array) $result[0]);
+    $actual = (array) $result[0];
+    // Sort the expected and actual array by key before asserting, to prevent
+    // that a different sequence of the columns in the table affect the check.
+    $this->assertSame(ksort($expected), ksort($actual));
 
     // Check that the field definition is marked for purging.
     $deleted_field_definitions = \Drupal::service('entity_field.deleted_fields_repository')->getFieldDefinitions();
