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

[Bug]: Pest\Mutate\MutationTest::calculateTimeout(): Return value must be of type int, float returned #1268

Closed
wietsewarendorff opened this issue Sep 20, 2024 · 2 comments · Fixed by pestphp/pest-plugin-mutate#16
Labels

Comments

@wietsewarendorff
Copy link

What Happened

Running mutation test and expected no errors (since I always write perfect code) but I ran into an error:

TypeError

  Pest\Mutate\MutationTest::calculateTimeout(): Return value must be of type int, float returned

  at vendor/pestphp/pest-plugin-mutate/src/MutationTest.php:110
    106▕         $initialTestSuiteDuration = Container::getInstance()->get(TelemetryRepository::class) // @phpstan-ignore-line
    107▕             ->getInitialTestSuiteDuration()
    108▕             ->seconds();
    109▕
  ➜ 110▕         return $initialTestSuiteDuration + max(5, $initialTestSuiteDuration * 0.2);
    111▕     }
    112▕
    113▕     public function hasFinished(): bool
    114▕     {

How to Reproduce

php artisan test --mutate --everything --path=app/

Sample Repository

No response

Pest Version

3.1.0

PHP Version

8.3.11

Operation System

Linux

Notes

setting the return type to float fixes the problem for me

@gehrisandro
Copy link
Contributor

Thanks @wietsewarendorff for raising the issue.

Has been fixed in pestphp/pest-plugin-mutate#16 (release is pending)

@wietsewarendorff
Copy link
Author

Thanks for the quick reply and fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants