-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Simplify mock credential * Increase HttpTimeout to 60s * Move debug helper out of Main.kt * Fix lint issues
- Loading branch information
1 parent
f28e163
commit fcb2cec
Showing
5 changed files
with
32 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
test_runner/src/main/kotlin/ftl/http/HttpTimeoutIncrease.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package ftl.http | ||
|
||
import com.google.api.client.http.HttpRequest | ||
import com.google.auth.Credentials | ||
import com.google.auth.http.HttpCredentialsAdapter | ||
|
||
/** Resolves timeout flakiness by increasing the timeout to 60s (the default is 20s) **/ | ||
class HttpTimeoutIncrease(credentials: Credentials) : HttpCredentialsAdapter(credentials) { | ||
override fun initialize(request: HttpRequest?) { | ||
super.initialize(request) | ||
|
||
request?.connectTimeout = 60 * 1000 | ||
request?.readTimeout = 60 * 1000 | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
test_runner/src/main/kotlin/ftl/http/TimeoutHttpRequestInitializer.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import ftl.Main | ||
import picocli.CommandLine | ||
|
||
object Debug { | ||
|
||
@JvmStatic | ||
@Suppress("UnusedPrivateMember") // Suppress detekt rule | ||
fun main(args: Array<String>) { | ||
// GoogleApiLogger.logAllToStdout() | ||
|
||
val arguments = arrayOf("firebase", "test", "android", "run") // for debugging. run test from IntelliJ IDEA | ||
CommandLine.run<Runnable>(Main(), System.out, *arguments) | ||
} | ||
} |