Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Arbitriaries outside jqwik execution #125

Closed
Danny02 opened this issue Oct 20, 2020 · 5 comments
Closed

Using Arbitriaries outside jqwik execution #125

Danny02 opened this issue Oct 20, 2020 · 5 comments
Labels

Comments

@Danny02
Copy link
Contributor

Danny02 commented Oct 20, 2020

Testing Problem

In my project I use JUnit5 alongside jqwik. Until Version 1.2.7 I could use Arbitrary samples in JUnit tests. With version 1.3.6 I get the error "The current action must be run on a jqwik thread ..." in CurrentTestDescriptor.get(), which is called in the initialization of the EdgeCaseFacadeImpl.

I know that I could replace all @test with @example, but JUnit has some other features one would want to use. And also most coworkers are more acustomed to using JUnit.

@jlink
Copy link
Owner

jlink commented Oct 20, 2020

@Danny02 Can you give an example how you use it? It should still work...

@Danny02
Copy link
Contributor Author

Danny02 commented Oct 21, 2020

@jlink
Copy link
Owner

jlink commented Oct 21, 2020

Copying over the example to have it handy:

public class UseSampleTest {

    @Test
    void useSample() {
        // strings uses EdgeCasesFacadeImpl, i.e. ints() does not
        Arbitraries.strings().sample();
    }
}

@jlink
Copy link
Owner

jlink commented Oct 21, 2020

It's definitely a bug.

Strangely enough I have tests for it, but they seem to work fine in the overall suite and only fail when run individually :-(

@jlink
Copy link
Owner

jlink commented Oct 21, 2020

Fixed and published in 1.3.7-SNAPSHOT: https://jqwik.net/release-notes.html#137-snapshot

@jlink jlink closed this as completed Oct 21, 2020
@jlink jlink removed the in progress label Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants