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

Make sure that container is shut down when tests fail #4940

Closed
tomas-langer opened this issue Sep 23, 2022 · 2 comments
Closed

Make sure that container is shut down when tests fail #4940

tomas-langer opened this issue Sep 23, 2022 · 2 comments
Assignees
Labels
2.x Issues for 2.x version branch bug Something isn't working P2

Comments

@tomas-langer
Copy link
Member

version 2.5.1: when a test @HelidonTest fails to start the container (such as when configuration is invalid for security), any further test classes annotated with @HelidonTest also fail to start with an exception:

java.lang.IllegalStateException: There is another builder in progress, or another Server running. You cannot run more than one in parallel
@tomas-langer tomas-langer added bug Something isn't working 2.x Issues for 2.x version branch labels Sep 23, 2022
@m0mus m0mus added the P2 label Sep 26, 2022
@tomas-langer
Copy link
Member Author

Confirmed with 2.5.3.

To reproduce:
Create an extension, such as:

package reproducer;

import javax.enterprise.event.Observes;
import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.DefinitionException;
import javax.enterprise.inject.spi.Extension;

public class FailingExtension implements Extension {
    private void observeAdd(@Observes AfterBeanDiscovery add) {
        throw new DefinitionException("Failed");
    }
}

To the first test that gets executed in IDE, add the following:

@AddExtension(FailingExtension.class)

Now run all tests in package - the first test will fail correctly:

javax.enterprise.inject.spi.DefinitionException: Failed

The second test will fail incorrectly:

java.lang.IllegalStateException: There is another builder in progress, or another Server running. You cannot run more than one in parallel

@tomas-langer
Copy link
Member Author

The same is valid in main, will start fixing in main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Issues for 2.x version branch bug Something isn't working P2
Projects
Archived in project
Development

No branches or pull requests

2 participants