From 7d9c51d73897930670c95fa78f29a01c584124d0 Mon Sep 17 00:00:00 2001
From: Lee Rowlands <lee.rowlands@previousnext.com.au>
Date: Mon, 10 Jul 2023 08:55:15 +1000
Subject: [PATCH] Issue #3355841 by mondrake: Allow
 DriverSpecificSchemaTestBase::testChangePrimaryKeyToSerial to execute for
 non-core drivers

---
 .../Core/Database/DriverSpecificSchemaTestBase.php         | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php b/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php
index 519094f66be5..342ed0ec3a7b 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/DriverSpecificSchemaTestBase.php
@@ -735,11 +735,16 @@ public function testChangePrimaryKeyToSerial(): void {
     }
 
     // Ensure auto numbering now works.
+    // We use a >= assertion to allow non-core drivers, that may have specific
+    // strategies on automatic incrementing, to run core tests. For example,
+    // Oracle will allocate a 10 id with the previous insert that was meant to
+    // fail; that id will be discarded, and the insert here will get a new 11
+    // id instead.
     $id = $this->connection
       ->insert($table_name)
       ->fields(['test_field_string' => 'test'])
       ->execute();
-    $this->assertEquals(10, $id);
+    $this->assertGreaterThanOrEqual(10, $id);
   }
 
   /**
-- 
GitLab