Skip to content

Commit

Permalink
Fix scalafmt issue for global execution context
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Dai <[email protected]>
  • Loading branch information
dai-chen committed Jul 24, 2024
1 parent 6660dfc commit bdf2d45
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@

package org.opensearch.flint.spark

import java.util.concurrent.Executors

import scala.collection.JavaConverters._
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future
import scala.concurrent.{ExecutionContext, Future}

import org.opensearch.action.admin.indices.settings.put.UpdateSettingsRequest
import org.opensearch.client.RequestOptions
Expand Down Expand Up @@ -37,6 +38,13 @@ class FlintSparkIndexSqlITSuite extends FlintSparkSuite with Matchers {
private val testMvIndex = s"spark_catalog.default.$testMvIndexShortName"
private val testMvFlintIndex = FlintSparkMaterializedView.getFlintIndexName(testMvIndex)

/**
* Creates a custom `ExecutionContext` with a fixed thread pool for handling asynchronous
* operations in tests. TODO: move to base class if more tests require this.
*/
implicit val executionContext: ExecutionContext =
ExecutionContext.fromExecutor(Executors.newFixedThreadPool(1))

override def beforeAll(): Unit = {
super.beforeAll()
createTimeSeriesTable(testTableQualifiedName)
Expand Down

0 comments on commit bdf2d45

Please sign in to comment.