-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
@rudolf101
Description
Description
During the concurrency collecting coverage reports for each generated test case, some threads fall asleep, which may cause a TimeoutException.
To Reproduce
Run UTBot via plugin on the following class and set timeout to 2-5 seconds. Choose Basic coverage mode.
class ScenarioBasicClass { functionToTest(a, b) { if (a > 10) { return a * b } else { return -1 } } }
Expected behavior
Tests are supposed to be generated without TimeoutException.
Actual behavior
Sometimes when threads fall asleep, unnecessary tests with TimeoutException are generated
Visual proofs (screenshots, logs, images)
Generated file:
const assert = require("assert") const fileUnderTest = require("./../scenarios/scenarioBasicClass.js") ///region Test suites for executable ScenarioBasicClass.functionToTest ///region it("testFunctionToTest1", function () { let scenarioBasicClass = new fileUnderTest.ScenarioBasicClass() let actual = scenarioBasicClass.functionToTest(false, -1) assert.deepEqual(-1, actual) } ) it("testFunctionToTest2", function () { let scenarioBasicClass = new fileUnderTest.ScenarioBasicClass() let actual = scenarioBasicClass.functionToTest(11, true) assert.deepEqual(11, actual) } ) ///endregion ///region Errors report for functionToTest it("testFunctionToTest_errors", function () { // Couldn't generate some tests. List of errors: // // 1 occurrences of: // Timeout in generating test for 11, -1024 parameters // 1 occurrences of: // Timeout in generating test for false, -1024 parameters // 1 occurrences of: // Timeout in generating test for false, 1024 parameters // 1 occurrences of: // Timeout in generating test for 1024, 1.0 parameters // 1 occurrences of: // Timeout in generating test for 1024, true parameters .... }
Environment
OS: Windows 10 Pro 21H1
JDK: Amazon Coretto 11.0.11
Intellij IDEA: Build #IU-222.3739.54
Additional context
The problem is observed more often on slow computers.
Metadata
Metadata
Assignees
Type
Projects
Status
Done