[2.x] fix: Sequence server start before publish in ivyless HTTP scripted tests

The ivyless-publish-http and ivyless-publish-http-plugin scripted tests
defined publishToHttp as three unordered `.value` dependencies
(startPublishServer, publish, stopPublishServer). sbt evaluates task
dependencies before the task body in an unspecified order, so publish
could run before the HTTP server was listening and fail intermittently
with "Connection refused". It is reproducible under CPU contention (a
2-vCPU runner), which is why it began flaking on the JDK-25 shard and
turned develop red.

Use Def.sequential to guarantee start -> publish -> stop ordering, the
way the sibling ivyless-publish-maven-http test already sequences via
separate scripted commands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Brian Hotopp 2026-07-16 11:53:54 -04:00
parent 271cde7025
commit 5ea994aa02
2 changed files with 2 additions and 10 deletions

View File

@ -38,11 +38,7 @@ stopPublishServer := {
}
val publishToHttp = taskKey[Unit]("Publish to HTTP server (start server, publish, stop server)")
publishToHttp := {
startPublishServer.value
try publish.value
finally stopPublishServer.value
}
publishToHttp := Def.sequential(startPublishServer, publish, stopPublishServer).value
val checkPublished = taskKey[Unit]("Check ivyless publish wrote the plugin cross-suffix PUT path")
checkPublished := {

View File

@ -35,11 +35,7 @@ stopPublishServer := {
}
val publishToHttp = taskKey[Unit]("Publish to HTTP server (start server, publish, stop server)")
publishToHttp := {
startPublishServer.value
try publish.value
finally stopPublishServer.value
}
publishToHttp := Def.sequential(startPublishServer, publish, stopPublishServer).value
val checkIvylessPublish = taskKey[Unit]("Check that ivyless publish produced the expected files")
checkIvylessPublish := {