diff --git a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
index de59c38bfc0fe2d5c3d1cfbf85b29239e19c0852..64a7a2f496bcb3bd51ace1493569455729ed2ba1 100644
--- a/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
+++ b/core/tests/Drupal/Tests/Core/Update/UpdateRegistryTest.php
@@ -236,8 +236,12 @@ public function testGetModuleUpdateFunctions() {
   public function testRegisterInvokedUpdatesWithoutExistingUpdates() {
     $this->setupBasicModules();
     $key_value = $this->prophesize(KeyValueStoreInterface::class);
-    $key_value->get('existing_updates', [])->willReturn([]);
-    $key_value->set('existing_updates', ['module_a_post_update_a'])->willReturn(NULL);
+    $key_value->get('existing_updates', [])
+      ->willReturn([])
+      ->shouldBeCalledTimes(1);
+    $key_value->set('existing_updates', ['module_a_post_update_a'])
+      ->willReturn(NULL)
+      ->shouldBeCalledTimes(1);
     $key_value = $key_value->reveal();
 
     $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
@@ -253,8 +257,12 @@ public function testRegisterInvokedUpdatesWithoutExistingUpdates() {
   public function testRegisterInvokedUpdatesWithMultiple() {
     $this->setupBasicModules();
     $key_value = $this->prophesize(KeyValueStoreInterface::class);
-    $key_value->get('existing_updates', [])->willReturn([]);
-    $key_value->set('existing_updates', ['module_a_post_update_a', 'module_a_post_update_b'])->willReturn(NULL);
+    $key_value->get('existing_updates', [])
+      ->willReturn([])
+      ->shouldBeCalledTimes(1);
+    $key_value->set('existing_updates', ['module_a_post_update_a', 'module_a_post_update_b'])
+      ->willReturn(NULL)
+      ->shouldBeCalledTimes(1);
     $key_value = $key_value->reveal();
 
     $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
@@ -270,8 +278,12 @@ public function testRegisterInvokedUpdatesWithMultiple() {
   public function testRegisterInvokedUpdatesWithExistingUpdates() {
     $this->setupBasicModules();
     $key_value = $this->prophesize(KeyValueStoreInterface::class);
-    $key_value->get('existing_updates', [])->willReturn(['module_a_post_update_b']);
-    $key_value->set('existing_updates', ['module_a_post_update_b', 'module_a_post_update_a'])->willReturn(NULL);
+    $key_value->get('existing_updates', [])
+      ->willReturn(['module_a_post_update_b'])
+      ->shouldBeCalledTimes(1);
+    $key_value->set('existing_updates', ['module_a_post_update_b', 'module_a_post_update_a'])
+      ->willReturn(NULL)
+      ->shouldBeCalledTimes(1);
     $key_value = $key_value->reveal();
 
     $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
@@ -287,8 +299,12 @@ public function testRegisterInvokedUpdatesWithExistingUpdates() {
   public function testFilterOutInvokedUpdatesByModule() {
     $this->setupBasicModules();
     $key_value = $this->prophesize(KeyValueStoreInterface::class);
-    $key_value->get('existing_updates', [])->willReturn(['module_a_post_update_b', 'module_a_post_update_a', 'module_b_post_update_a']);
-    $key_value->set('existing_updates', ['module_b_post_update_a'])->willReturn(NULL);
+    $key_value->get('existing_updates', [])
+      ->willReturn(['module_a_post_update_b', 'module_a_post_update_a', 'module_b_post_update_a'])
+      ->shouldBeCalledTimes(1);
+    $key_value->set('existing_updates', ['module_b_post_update_a'])
+      ->willReturn(NULL)
+      ->shouldBeCalledTimes(1);
     $key_value = $key_value->reveal();
 
     $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [