File tree Expand file tree Collapse file tree
lithic-java-core/src/main/kotlin/com/lithic/api/core/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ tasks.withType<Test>().configureEach {
4545
4646val palantir by configurations.creating
4747dependencies {
48- palantir(" com.palantir.javaformat:palantir-java-format:2.73 .0" )
48+ palantir(" com.palantir.javaformat:palantir-java-format:2.89 .0" )
4949}
5050
5151fun registerPalantir (
Original file line number Diff line number Diff line change @@ -214,13 +214,8 @@ private constructor(
214214 }
215215 }
216216 ?.let { retryAfterNanos ->
217- // If the API asks us to wait a certain amount of time (and it's a reasonable
218- // amount), just
219- // do what it says.
220- val retryAfter = Duration .ofNanos(retryAfterNanos.toLong())
221- if (retryAfter in Duration .ofNanos(0 ).. Duration .ofMinutes(1 )) {
222- return retryAfter
223- }
217+ // If the API asks us to wait a certain amount of time, do what it says.
218+ return Duration .ofNanos(retryAfterNanos.toLong())
224219 }
225220
226221 // Apply exponential backoff, but not more than the max.
Original file line number Diff line number Diff line change @@ -21,11 +21,22 @@ echo "==> Starting mock server with URL ${URL}"
2121
2222# Run prism mock on the given spec
2323if [ " $1 " == " --daemon" ]; then
24+ # Pre-install the package so the download doesn't eat into the startup timeout
25+ npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version
26+
2427 npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock " $URL " & > .prism.log &
2528
26- # Wait for server to come online
29+ # Wait for server to come online (max 30s)
2730 echo -n " Waiting for server"
31+ attempts=0
2832 while ! grep -q " ✖ fatal\|Prism is listening" " .prism.log" ; do
33+ attempts=$(( attempts + 1 ))
34+ if [ " $attempts " -ge 300 ]; then
35+ echo
36+ echo " Timed out waiting for Prism server to start"
37+ cat .prism.log
38+ exit 1
39+ fi
2940 echo -n " ."
3041 sleep 0.1
3142 done
You can’t perform that action at this time.
0 commit comments