Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] PHP Fatal error: Uncaught ValueError: str_repeat() #865

Open
millnut opened this issue Jul 12, 2024 · 2 comments
Open

[6.x] PHP Fatal error: Uncaught ValueError: str_repeat() #865

millnut opened this issue Jul 12, 2024 · 2 comments
Labels

Comments

@millnut
Copy link

millnut commented Jul 12, 2024

Paratest returns this error when a test fails

ParaTest v6.11.1 upon PHPUnit 9.6.20 by Sebastian Bergmann and contributors.

PHP Fatal error:  Uncaught ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0 in /app/vendor/brianium/paratest/src/Logging/JUnit/Reader.php:109
Stack trace:
#0 /app/vendor/brianium/paratest/src/Logging/JUnit/Reader.php(109): str_repeat('.', -1)
#1 /app/vendor/brianium/paratest/src/Runners/PHPUnit/ResultPrinter.php(403): ParaTest\Logging\JUnit\Reader->getFeedback()
#2 /app/vendor/brianium/paratest/src/Runners/PHPUnit/ResultPrinter.php(305): ParaTest\Runners\PHPUnit\ResultPrinter->processReaderFeedback(Object(ParaTest\Logging\JUnit\Reader), 1)
#3 /app/vendor/brianium/paratest/src/Runners/PHPUnit/Runner.php(108): ParaTest\Runners\PHPUnit\ResultPrinter->printFeedback(Object(ParaTest\Runners\PHPUnit\TestMethod))
#4 /app/vendor/brianium/paratest/src/Runners/PHPUnit/Runner.php(41): ParaTest\Runners\PHPUnit\Runner->testIsStillRunning(Object(ParaTest\Runners\PHPUnit\Worker\RunnerWorker))
#5 /app/vendor/brianium/paratest/src/Runners/PHPUnit/BaseRunner.php(80): ParaTest\Runners\PHPUnit\Runner->doRun()
#6 /app/vendor/brianium/paratest/src/Console/Commands/ParaTestCommand.php(102): ParaTest\Runners\PHPUnit\BaseRunner->run()
#7 /app/vendor/symfony/console/Command/Command.php(326): ParaTest\Console\Commands\ParaTestCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /app/vendor/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /app/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(ParaTest\Console\Commands\ParaTestCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /app/vendor/brianium/paratest/bin/paratest(37): Symfony\Component\Console\Application->run()
#12 /app/vendor/bin/paratest(119): include('/app/vendor/bri...')
#13 {main}
  thrown in /app/vendor/brianium/paratest/src/Logging/JUnit/Reader.php on line 109

Fatal error: Uncaught ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0 in /app/vendor/brianium/paratest/src/Logging/JUnit/Reader.php:109
Stack trace:
#0 /app/vendor/brianium/paratest/src/Logging/JUnit/Reader.php(109): str_repeat('.', -1)
#1 /app/vendor/brianium/paratest/src/Runners/PHPUnit/ResultPrinter.php(403): ParaTest\Logging\JUnit\Reader->getFeedback()
#2 /app/vendor/brianium/paratest/src/Runners/PHPUnit/ResultPrinter.php(305): ParaTest\Runners\PHPUnit\ResultPrinter->processReaderFeedback(Object(ParaTest\Logging\JUnit\Reader), 1)
#3 /app/vendor/brianium/paratest/src/Runners/PHPUnit/Runner.php(108): ParaTest\Runners\PHPUnit\ResultPrinter->printFeedback(Object(ParaTest\Runners\PHPUnit\TestMethod))
#4 /app/vendor/brianium/paratest/src/Runners/PHPUnit/Runner.php(41): ParaTest\Runners\PHPUnit\Runner->testIsStillRunning(Object(ParaTest\Runners\PHPUnit\Worker\RunnerWorker))
#5 /app/vendor/brianium/paratest/src/Runners/PHPUnit/BaseRunner.php(80): ParaTest\Runners\PHPUnit\Runner->doRun()
#6 /app/vendor/brianium/paratest/src/Console/Commands/ParaTestCommand.php(102): ParaTest\Runners\PHPUnit\BaseRunner->run()
#7 /app/vendor/symfony/console/Command/Command.php(326): ParaTest\Console\Commands\ParaTestCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /app/vendor/symfony/console/Application.php(1078): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /app/vendor/symfony/console/Application.php(324): Symfony\Component\Console\Application->doRunCommand(Object(ParaTest\Console\Commands\ParaTestCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /app/vendor/symfony/console/Application.php(175): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /app/vendor/brianium/paratest/bin/paratest(37): Symfony\Component\Console\Application->run()
#12 /app/vendor/bin/paratest(119): include('/app/vendor/bri...')
#13 {main}
  thrown in /app/vendor/brianium/paratest/src/Logging/JUnit/Reader.php on line 109

phpunit (same test, but this error is shown)

PHPUnit 9.6.20 by Sebastian Bergmann and contributors.

Testing /app/web/profiles/contrib/localgov
F                                                                   1 / 1 (100%)R

Time: 00:15.065, Memory: 10.00 MB

There was 1 failure:

1) Drupal\Tests\localgov\Functional\LocalGovUpdateTest::testUpdate
Test was run in child process and ended unexpectedly

/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php:685
/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php:685
/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651
/app/vendor/phpunit/phpunit/src/TextUI/Command.php:146
/app/vendor/phpunit/phpunit/src/TextUI/Command.php:99

--

There was 1 risky test:

1) Drupal\Tests\localgov\Functional\LocalGovUpdateTest::testUpdate
This test did not perform any assertions

/app/web/core/tests/Drupal/Tests/Listeners/DrupalListener.php:62
/app/vendor/phpunit/phpunit/src/Framework/TestResult.php:453
/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php:685
/app/vendor/phpunit/phpunit/src/Framework/TestSuite.php:685
/app/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651
/app/vendor/phpunit/phpunit/src/TextUI/Command.php:146
/app/vendor/phpunit/phpunit/src/TextUI/Command.php:99

FAILURES!
Tests: 1, Assertions: 0, Failures: 1, Risky: 1.

This hides other test errors when this occurs on a CI workflow and makes it difficult to see what tests have actually failed

@millnut millnut added the bug label Jul 12, 2024
@millnut millnut changed the title PHP Fatal error: Uncaught ValueError: str_repeat() [6.x] PHP Fatal error: Uncaught ValueError: str_repeat() Jul 12, 2024
Copy link

This issue has gone two months without activity. In another two weeks, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Backlog or In Progress, I will leave it alone ... forever!

@github-actions github-actions bot added the Stale label Sep 14, 2024
@staabm
Copy link
Contributor

staabm commented Sep 16, 2024

could you provide a small reproducing example?

@github-actions github-actions bot removed the Stale label Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants