UnitTestBot / UTBotCpp

Tool that generates unit test by C/C++ source code, trying to reach all branches and maximize code coverage
Apache License 2.0
158 stars 27 forks source link

[BUG] Timeout from setting is not used during test generation #476

Open tyuldashev opened 2 years ago

tyuldashev commented 2 years ago

Description It seems that timeout set in VSCode extension settings is not applied during test generation. Or it covers another error.

To Reproduce Steps to reproduce the behavior:

  1. Open settings for UTBot extension
  2. Set "Timeout per Test" (and "Timeout per Function" just in case) to 600, which should be equal to 10min
  3. Run test generation on following code:
    int arr_sum(int arr[], int N) {
    int sum = 0;
    int i = 0;
    while(i < N) {
        sum += arr[i];
    };
    return sum;
    }

Expected behavior Tests are supposed to be generated or timeout happen in 10 minutes

Actual behavior Quite quickly (in about 30sec) one test is generated but description of the tests contains following line

namespace UTBot {
// Some tests for function 'arr_sum' were skipped, as execution of function is out of timeout.
ladisgin commented 2 years ago

We have additional timeout inside UTBot --bcov-check-interval=8s

hustmurphy commented 1 year ago

I also encounter the same problem, have you solved it? @tyuldashev

hustmurphy commented 1 year ago

I use CLI test as command like "/root/utbot-release-2022.10.8/utbot_distr/server-install/utbot generate --test-timeout -1 --function-timeout -1 -p "src" function -f src/main.c --line-number 31". My function logic is simple,but struct is complex.