Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JavaScript: Treads fall asleep due to concurrency while collecting coverage data, which produces TimeoutException #1048

Closed
Assignees
Labels
ctg-bugIssue is a bug lang-javascriptIssue is related to JavaScript support
@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

Labels

ctg-bugIssue is a bug lang-javascriptIssue is related to JavaScript support

Type

No type

Projects

Status

Done

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /