diff -u b/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php --- b/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/UpgradePathTestBase.php @@ -185,11 +185,9 @@ global $conf; cache('bootstrap')->delete('variables'); $conf = variable_initialize(); - try { - drupal_container()->get('config.factory')->reset(); - } - catch (InvalidArgumentException $e) { - // If there is no config factory defined, there is nothing to reset. + $container = drupal_container(); + if ($container->has('config.factory')) { + $container->get('config.factory')->reset(); } } }