Skip to content

Commit

Permalink
Add more 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 Nov 16, 2023
1 parent 6ada7d5 commit e26a909
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,25 @@ class FlintSparkIndexMonitorITSuite extends OpenSearchTransactionSuite with Matc
}
}

test("job start time should not change until recover index") {
val (prevJobStartTime, _) = getLatestTimestamp

// Stop streaming job and wait for monitor task stopped
spark.streams.active.find(_.name == testFlintIndex).get.stop()
waitForMonitorTaskRun()

// Restart streaming job and monitor task
flint.recoverIndex(testFlintIndex)
waitForMonitorTaskRun()

val (jobStartTime, _) = getLatestTimestamp
jobStartTime should be > prevJobStartTime
}

test("monitor task should terminate if streaming job inactive") {
val task = FlintSparkIndexMonitor.indexMonitorTracker(testFlintIndex)

// Stop streaming job intentionally
// Stop streaming job and wait for monitor task stopped
spark.streams.active.find(_.name == testFlintIndex).get.stop()
waitForMonitorTaskRun()

Expand Down

0 comments on commit e26a909

Please sign in to comment.