-
Notifications
You must be signed in to change notification settings - Fork 274
fix: Replaced classLoader in DriverJar #1811
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
Changes from 4 commits
a7830eb
2b8f04d
3c925b1
04b40cf
999cef6
2b34498
ef25b16
3da9be6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -e | ||
| set +x | ||
|
|
||
| cd "$(dirname "$0")" | ||
| mvn package -D skipTests --no-transfer-progress | ||
| java -jar target/test-spring-boot-starter*.jar --async |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,8 @@ | |
| import org.springframework.boot.SpringApplication; | ||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
|
||
| import java.util.concurrent.CompletableFuture; | ||
|
|
||
| @SpringBootApplication | ||
| public class TestApp implements CommandLineRunner { | ||
|
|
||
|
|
@@ -14,6 +16,24 @@ public static void main(String[] args) { | |
|
|
||
| @Override | ||
| public void run(String... args) { | ||
| if (args.length == 0) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about the following, so that each version is called from exactly one branch? if (Arrays.asList(args).contains("--async")) {
runAsync();
} else {
runSync();
}
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That’s a great suggestion.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for contributing this and for your patience addressing all the review comments!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m glad I had the opportunity to contribute. Since this was my first open source contribution, I struggled quite a bit, but your reviews and comments were a huge help. Thank you! |
||
| runSync(); | ||
| } else { | ||
| if ("--async".equals(args[0])) { | ||
| runAsync(); | ||
| } | ||
| else { | ||
| runSync(); | ||
| } | ||
| } | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I modified the if statement to prevent an IndexOutOfBoundsException. |
||
| } | ||
|
|
||
| private void runAsync() { | ||
| CompletableFuture<Void> voidCompletableFuture = CompletableFuture.runAsync(this::runSync); | ||
| voidCompletableFuture.join(); | ||
| } | ||
|
|
||
| private void runSync() { | ||
| try (Playwright playwright = Playwright.create()) { | ||
| BrowserType browserType = getBrowserTypeFromEnv(playwright); | ||
| System.out.println("Running test with " + browserType.name()); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid the docker test failures let's just add
docker stop "${CONTAINER_ID}"to this (and the new) step to shutdown the container after the test has finished. Or better yet, since the container is the same in both steps, you can move its creation in a separate step and then use its CONTAINER_ID without relaunching, something likeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added example code and stop step