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

pynguin takes long time even when specifying timeout options #46

Open
exKAZUu opened this issue Jul 11, 2023 · 1 comment
Open

pynguin takes long time even when specifying timeout options #46

exKAZUu opened this issue Jul 11, 2023 · 1 comment

Comments

@exKAZUu
Copy link

exKAZUu commented Jul 11, 2023

Describe the bug
When pynguin generates test cases for a program that may occur an infinite loop, pynguin takes long time (even when specifying timeout options).

To Reproduce

  1. Create loop.py with the following content:
def func(n: int):
    while n == 0:
        pass
    return n
  1. Run pynguin with the following command: PYNGUIN_DANGER_AWARE=1 pynguin --project-path . --output-path output --module-name loop --maximum-search-time 1 --maximum-slicing-time 1 --maximum-test-execution-timeout 1 --maximum-test-execution-timeout 1 --test-execution-time-per-statement 1 --max-size 1 --max-length-test-case 1 --max-int 10 --assertion_generation SIMPLE --algorithm MOSA
  2. pynguin takes about 30 seconds

Expected behavior
I can imagine there are various mandatory processes where it is difficult to limit execution times, but, I'd like pynguin stop until 5 seconds when specifying the above options.

Screenshots
image

Software Version:

  • OS: macOS
  • Python: 3.10.9
  • Poetry: 1.4.0
  • Pynguin: 0.33.0
@exKAZUu exKAZUu changed the title pynguin takes too long time even when specifying timeout options pynguin takes long time even when specifying timeout options Jul 11, 2023
@stephanlukasczyk
Copy link
Member

Dear @exKAZUu ,

Thank you for your interest in Pynguin and reporting this bug. I agree that this is definitely a bug and a behaviour that should be fixed. The problem seems to be in the execution, where one of the generated inputs triggers an infinite loop. The thread used for execution is then killed, which causes the RuntimeError.

Unfortunately, I am very busy with other things, thus I cannot promise when I can work on a fix for this. I'll keep this bug open and refer to it whenever I find the time.

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

No branches or pull requests

2 participants