Movatterモバイル変換


[0]ホーム

URL:


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

Try another approach to mark hanging generated tests #371#554

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@Vassiliy-Kudryashov
Copy link
Member

@Vassiliy-KudryashovVassiliy-Kudryashov commentedJul 19, 2022
edited
Loading

Description

Note, this issue affects JUnit 5 only!

New methods and entities were added to codegen to provide requiredassertion wrapper. Now tests with timeout are being abrupt just after exceeding time limit.

Fixes#371

Type of Change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Manual Scenario

Set handing test timeout to 100ms and generate tests for the example:

package issue371;import java.io.File;public class PomXmlFinder {    public static void main(String[] args) {        scan(new File("C:\\"));    }    private static int counter = 0;    private static void scan(File file) {        if (counter > 10) return;        if (file.isFile() && file.getName().equals("pom.xml")) {            counter++;            if (counter > 10) return;            System.out.println(file.getAbsolutePath());        }        File[] files = file.listFiles();        if (files != null) {            for (File child : files) {                scan(child);            }        }    }}

Generated test methods should be not only annotated with@Timeout tag but also have wrappers likeassertTimeoutPreemptively(Duration.ofMillis(100L), () -> PomXmlFinder.main(stringArray)); inside

Checklist (remove irrelevant options):

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • No new warnings

@Vassiliy-KudryashovVassiliy-Kudryashov deleted the Vassiliy-Kudryashov/371-try-another-approach-to-mark-hanging-generated-tests branchJuly 19, 2022 15:48
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@DamtevDamtevDamtev approved these changes

Assignees

No one assigned

Labels

None yet

Projects

Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Try another approach to mark hanging generated tests

3 participants

@Vassiliy-Kudryashov@Damtev

[8]ページ先頭

©2009-2025 Movatter.jp