Skip to content
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

Fix Test Container Timeout Issue #1365

Merged
merged 3 commits into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PublishApiTests extends ControllerBaseSuite with BeforeAndAfterEach {
override protected def beforeEach(): Unit = database.reset()

it("sonatype should publish any artifact") {
implicit val customTimeout = RouteTestTimeout(2.seconds)
implicit val customTimeout = RouteTestTimeout(8.seconds)
val pomFile = pomResolver.resolveSync(Cats.`core_3:2.6.1`.mavenReference)
val creationDate = Cats.`core_3:2.6.1`.releaseDate.getEpochSecond
val entity = HttpEntity.fromPath(ContentTypes.`application/octet-stream`, pomFile)
Expand Down
5 changes: 3 additions & 2 deletions project/Elasticsearch.scala
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ object Elasticsearch extends AutoPlugin {
"/usr/share/elasticsearch/data",
BindMode.READ_WRITE
)
// container.withLogConsumer(frame => logger.info(frame.getUtf8StringWithoutLineEnding))
val port =
try {
container.start()
Expand All @@ -83,7 +84,7 @@ object Elasticsearch extends AutoPlugin {
container.stop()
throw e
}
logger.info(s"Ealsticsearch container started on port $port")
logger.info(s"Elasticsearch container started on port $port")
containers(dataFolder.toPath) = container
(container.getContainerId, port)
}
Expand All @@ -92,7 +93,7 @@ object Elasticsearch extends AutoPlugin {
val url = new URL(s"http://localhost:$port/")
try {
val connection = url.openConnection().asInstanceOf[HttpURLConnection]
connection.setConnectTimeout(100)
connection.setConnectTimeout(200)
connection.connect()
val respCode = connection.getResponseCode
if (respCode != HttpURLConnection.HTTP_OK)
Expand Down
Loading