diff --git a/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php b/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
index f484585dcbe..0e8fee10215 100644
--- a/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
+++ b/core/tests/Drupal/BuildTests/Framework/BuildTestBase.php
@@ -11,7 +11,7 @@
 use PHPUnit\Framework\TestCase;
 use Symfony\Component\Filesystem\Filesystem as SymfonyFilesystem;
 use Symfony\Component\Finder\Finder;
-use Symfony\Component\Lock\Factory;
+use Symfony\Component\Lock\LockFactory;
 use Symfony\Component\Lock\Store\FlockStore;
 use Symfony\Component\Process\PhpExecutableFinder;
 use Symfony\Component\Process\Process;
@@ -457,7 +457,7 @@ protected function stopServer() {
    */
   protected function findAvailablePort() {
     $store = new FlockStore(DrupalFilesystem::getOsTemporaryDirectory());
-    $lock_factory = new Factory($store);
+    $lock_factory = new LockFactory($store);
 
     $counter = 100;
     while ($counter--) {
