Skip to content
Closed
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 @@ -28,6 +28,7 @@ import com.spotify.docker.client._
import com.spotify.docker.client.exceptions.ImageNotFoundException
import com.spotify.docker.client.messages.{ContainerConfig, HostConfig, PortBinding}
import org.scalatest.concurrent.Eventually
import org.scalatest.concurrent.PatienceConfiguration.Timeout
import org.scalatest.time.SpanSugar._

import org.apache.spark.sql.test.SharedSparkSession
Expand Down Expand Up @@ -95,6 +96,7 @@ abstract class DockerJDBCIntegrationSuite extends SharedSparkSession with Eventu

protected val dockerIp = DockerUtils.getDockerIp()
val db: DatabaseOnDocker
val connectionTimeout: Timeout = timeout(2.minute)

private var docker: DockerClient = _
protected var externalPort: Int = _
Expand Down Expand Up @@ -155,7 +157,7 @@ abstract class DockerJDBCIntegrationSuite extends SharedSparkSession with Eventu
docker.startContainer(containerId)
jdbcUrl = db.getJdbcUrl(dockerIp, externalPort)
var conn: Connection = null
eventually(timeout(2.minutes), interval(1.second)) {
eventually(connectionTimeout, interval(1.second)) {
conn = getConnection()
}
// Run any setup queries:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import java.math.BigDecimal
import java.sql.{Connection, Date, Timestamp}
import java.util.{Properties, TimeZone}

import org.scalatest.concurrent.PatienceConfiguration.Timeout
import org.scalatest.time.SpanSugar._

import org.apache.spark.sql.{Row, SaveMode}
import org.apache.spark.sql.execution.{RowDataSourceScanExec, WholeStageCodegenExec}
import org.apache.spark.sql.execution.datasources.LogicalRelation
Expand All @@ -37,10 +40,7 @@ import org.apache.spark.tags.DockerTest
* 2. export ORACLE_DOCKER_IMAGE_NAME=$ORACLE_DOCKER_IMAGE_NAME
* Pull oracle $ORACLE_DOCKER_IMAGE_NAME image - docker pull $ORACLE_DOCKER_IMAGE_NAME
* 3. Start docker - sudo service docker start
* 4. The timeout and interval parameter to be increased to a high value for oracle test in
* DockerJDBCIntegrationSuite.scala (Locally tested with 20 min timeout and 1 sec interval
* then executed successfully).
* 5. Run spark test - ./build/sbt -Pdocker-integration-tests
* 4. Run spark test - ./build/sbt -Pdocker-integration-tests
* "test-only org.apache.spark.sql.jdbc.OracleIntegrationSuite"
*
* An actual sequence of commands to run the test is as follows
Expand Down Expand Up @@ -71,6 +71,8 @@ class OracleIntegrationSuite extends DockerJDBCIntegrationSuite with SharedSpark
s"jdbc:oracle:thin:system/oracle@//$ip:$port/xe"
}

override val connectionTimeout: Timeout = timeout(10.minutes)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you need 20.minutes in Oracle Kerberos PR, you can increase this at that PR.


override def dataPreparation(conn: Connection): Unit = {
// In 18.4.0 Express Edition auto commit is enabled by default.
conn.setAutoCommit(false)
Expand Down