Skip to content

Commit f60d2f2

Browse files
committed
Ensure tests properly test agent attach with existing clients
1 parent f45251b commit f60d2f2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/test/kotlin/IntegrationTests.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const val proxyHost = "127.0.0.1"
1616
val certPath = resourcesPath.resolve("cert.pem").toAbsolutePath().toString()
1717

1818
// We always launch subprocesses with the same Java that we're using ourselves
19-
val javaPath = Paths.get(System.getProperty("java.home"), "bin", "java").toString()!!
19+
val javaPath = Paths.get(System.getProperty("java.home"), "bin", "java").toString()
2020

2121
val wireMockServer = WireMockServer(options()
2222
.dynamicPort()
@@ -68,12 +68,12 @@ class IntegrationTests : StringSpec({
6868
runningProcs.add(agentAttachProc)
6969

7070
// Agent attacher should quit happily
71-
agentAttachProc.waitFor(1, TimeUnit.SECONDS)
71+
agentAttachProc.waitFor(2, TimeUnit.SECONDS)
7272
agentAttachProc.isAlive.shouldBe(false)
7373
agentAttachProc.exitValue().shouldBe(0)
7474

7575
// Target should pick up proxy details & quit happily too
76-
targetProc.waitFor(5, TimeUnit.SECONDS)
76+
targetProc.waitFor(10, TimeUnit.SECONDS)
7777
targetProc.isAlive.shouldBe(false)
7878
targetProc.exitValue().shouldBe(0)
7979
}

test-app/src/main/java/tech/httptoolkit/testapp/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static void main(String[] args) throws Exception {
4646

4747
cases.forEach((name, clientCase) -> {
4848
try {
49-
int result = clientCase.testNew(url);
49+
int result = clientCase.testExisting(url);
5050
if (result != 200) {
5151
System.out.println("Unexpected result for existing " + name + ": " + result);
5252
allSuccessful.set(false);

0 commit comments

Comments
 (0)