Skip to content

Commit

Permalink
fix long run in phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
oallain committed Jun 27, 2022
1 parent c60d0b2 commit a1046b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions ruleset/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ parameters:
- '#^Method [\w\\]+Type::render\(\) has parameter \$[\w]+ with no typehint specified.$#'
- '#Variable method call on Synolia\\SyliusSchedulerCommandPlugin\\Entity\\ScheduledCommand.#'
- '#Cannot call method [a-zA-Z0-9]+\(\) on Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface\|null.#'
- # caused by check if process is running in a while loop
message: "#^Negated boolean expression is always false\\.$#"
count: 1
path: ../src/Runner/ScheduleCommandRunner.php
3 changes: 3 additions & 0 deletions src/Runner/ScheduleCommandRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ private function startProcess(Process $process): void
}

for ($i = 0; $i < $this->pingInterval; ++$i) {
if (!$process->isRunning()) {
return;
}
\sleep(1);

$process->checkTimeout();
Expand Down
6 changes: 3 additions & 3 deletions tests/Behat/Resources/suites.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ default:
- synolia_sylius_scheduler_command_plugin.behat.context.ui.admin.command
- synolia_sylius_scheduler_command_plugin.behat.context.cli.cli_context
filters:
tags: '@managing_command && @ui'
tags: '@managing_command&&@ui'

ui_managing_scheduled_command:
contexts:
Expand All @@ -30,7 +30,7 @@ default:
- synolia_sylius_scheduler_command_plugin.behat.context.ui.admin.scheduled_command
- synolia_sylius_scheduler_command_plugin.behat.context.cli.cli_context
filters:
tags: '@managing_scheduled_command && @ui'
tags: '@managing_scheduled_command&&@ui'

cli_run_command:
contexts:
Expand All @@ -40,4 +40,4 @@ default:

- synolia_sylius_scheduler_command_plugin.behat.context.cli.cli_context
filters:
tags: "@cli && @cli_run_command"
tags: "@cli&&@cli_run_command"

0 comments on commit a1046b2

Please # to comment.