Skip to content

Commit

Permalink
test: block parser spec longer timeout for container
Browse files Browse the repository at this point in the history
  • Loading branch information
nopcoder committed Sep 11, 2023
1 parent abf880a commit b31d073
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import matchers.should._
import org.scalatest.matchers.must.Matchers.contain
import org.scalatest.matchers.should.Matchers.convertToAnyShouldWrapper
import funspec._

import com.dimafeng.testcontainers.{ForAllTestContainer, GenericContainer}
import com.dimafeng.testcontainers.GenericContainer.FileSystemBind
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy
Expand All @@ -15,6 +14,7 @@ import java.io.File
import java.nio.charset.StandardCharsets
import org.apache.commons.io.IOUtils

import java.time.Duration
import scala.io.Source

class BlockReadableSpec extends AnyFunSpec with Matchers {
Expand Down Expand Up @@ -306,17 +306,21 @@ class GolangContainerSpec extends AnyFunSpec with ForAllTestContainer {
override val container: GenericContainer = GenericContainer(
"golang:1.20.6-alpine",
classpathResourceMapping = Seq(
FileSystemBind("parser-test/sst_files_generator.go", "/local/sst_files_generator.go", BindMode.READ_WRITE),
FileSystemBind("parser-test/sst_files_generator.go",
"/local/sst_files_generator.go",
BindMode.READ_WRITE
),
FileSystemBind("parser-test/go.mod", "/local/go.mod", BindMode.READ_WRITE),
FileSystemBind("parser-test/go.sum", "/local/go.sum", BindMode.READ_WRITE)
),
command = Seq("/bin/sh",
"-c",
"cd /local && CGO_ENABLED=0 go run sst_files_generator.go && echo \"done\""
),
waitStrategy = new LogMessageWaitStrategy().withRegEx(
"done\\n"
) // TODO(Tals): use startupCheckStrategy instead of waitStrategy (https://github.com/treeverse/lakeFS/issues/2455)
// TODO(Tals): use startupCheckStrategy instead of waitStrategy (https://github.com/treeverse/lakeFS/issues/2455)
waitStrategy = new LogMessageWaitStrategy()
.withRegEx("done\\n")
.withStartupTimeout(Duration.ofSeconds(120))
)

describe("A block parser") {
Expand Down

0 comments on commit b31d073

Please sign in to comment.