GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Try another approach to mark hanging generated tests #371 by Vassiliy-Kudryashov · Pull Request #554 · UnitTestBot/UTBotJava

Conversation

@Vassiliy-Kudryashov

@Vassiliy-Kudryashov Vassiliy-Kudryashov commented Jul 19, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Description

Note, this issue affects JUnit 5 only!

New methods and entities were added to codegen to provide required assertion 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 like assertTimeoutPreemptively(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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Vassiliy-Kudryashov
Try another approach to mark hanging generated tests #371
d85ad91
@Vassiliy-Kudryashov
Vassiliy-Kudryashov requested a review from Damtev July 19, 2022 13:53
@Vassiliy-Kudryashov Vassiliy-Kudryashov linked an issue Jul 19, 2022 that may be closed by this pull request
Try another approach to mark hanging generated tests #371
Closed
@Vassiliy-Kudryashov
Vassiliy-Kudryashov enabled auto-merge (squash) July 19, 2022 14:20
Damtev
Damtev approved these changes Jul 19, 2022
View reviewed changes
@Vassiliy-Kudryashov
Vassiliy-Kudryashov merged commit 2fc63ac into main Jul 19, 2022
@Vassiliy-Kudryashov
Vassiliy-Kudryashov deleted the Vassiliy-Kudryashov/371-try-another-approach-to-mark-hanging-generated-tests branch July 19, 2022 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Damtev Damtev Damtev approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

UTBot Java
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Try another approach to mark hanging generated tests

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@Vassiliy-Kudryashov @Damtev
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.