3 namespace Drupal\TestSite\Commands;
5 use Drupal\Core\Test\TestDatabase;
6 use Symfony\Component\Console\Command\Command;
7 use Symfony\Component\Console\Input\InputInterface;
8 use Symfony\Component\Console\Output\OutputInterface;
11 * Command to release all test site database prefix locks.
13 * Note that this command can't be safely tested by DrupalCI without potentially
14 * causing random failures.
18 class TestSiteReleaseLocksCommand extends Command {
23 protected function configure() {
24 $this->setName('release-locks')
25 ->setDescription('Releases all test site locks')
26 ->setHelp('The locks ensure test site database prefixes are not reused.');
32 protected function execute(InputInterface $input, OutputInterface $output) {
33 TestDatabase::releaseAllTestLocks();
34 $output->writeln('<info>Successfully released all the test database locks</info>');