diff --git a/core/modules/rest/tests/src/Functional/ResourceTestBase.php b/core/modules/rest/tests/src/Functional/ResourceTestBase.php
index 8283bef..6090668 100644
--- a/core/modules/rest/tests/src/Functional/ResourceTestBase.php
+++ b/core/modules/rest/tests/src/Functional/ResourceTestBase.php
@@ -10,6 +10,7 @@
 use Drupal\user\RoleInterface;
 use GuzzleHttp\RequestOptions;
 use Psr\Http\Message\ResponseInterface;
+use Symfony\Component\Filesystem\LockHandler;
 
 /**
  * Subclass this for every REST resource, every format and every auth provider.
@@ -349,7 +350,11 @@ protected function request($method, Url $url, array $request_options) {
     $request_options[RequestOptions::ALLOW_REDIRECTS] = FALSE;
     $request_options = $this->decorateWithXdebugCookie($request_options);
     $client = $this->getSession()->getDriver()->getClient()->getClient();
-    return $client->request($method, $url->setAbsolute(TRUE)->toString(), $request_options);
+    $lockHandler = new LockHandler('request.lock');
+    if ($lockHandler->lock(TRUE)) {
+      $response = $client->request($method, $url->setAbsolute(TRUE)->toString(), $request_options);
+    }
+    return $response;
   }
 
   /**
