Skip to content

Commit

Permalink
Fix broken IT
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Dai <[email protected]>
  • Loading branch information
dai-chen committed May 21, 2024
1 parent 66257a4 commit 941ed42
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ class FlintSpark(val spark: SparkSession) extends FlintSparkTransactionSupport w
*/
def updateIndex(index: FlintSparkIndex): Option[String] = {
val indexName = index.name()
withTransaction[Option[String]](indexName, s"Update Flint index $indexName") { tx =>
validateUpdateAllowed(
describeIndex(indexName)
.getOrElse(throw new IllegalStateException(s"Index $indexName doesn't exist"))
.options,
index.options)
validateUpdateAllowed(
describeIndex(indexName)
.getOrElse(throw new IllegalStateException(s"Index $indexName doesn't exist"))
.options,
index.options)

withTransaction[Option[String]](indexName, s"Update Flint index $indexName") { tx =>
// Relies on validation to forbid auto-to-auto and manual-to-manual updates
index.options.autoRefresh() match {
case true => updateIndexManualToAuto(index, tx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ class FlintSparkTransactionITSuite extends OpenSearchTransactionSuite with Match
.onTable(testTable)
.addValueSet("name")
.create()
} should have message s"Flint index $testFlintIndex already exists"
} should have message
s"Failed to execute index operation [Create Flint index $testFlintIndex with ignoreIfExists false] caused by: Flint index $testFlintIndex already exists"
}

test("should clean up metadata log entry if index data has been deleted") {
Expand Down

0 comments on commit 941ed42

Please sign in to comment.