Skip to content

Commit

Permalink
changed booleanSupplier appropriately
Browse files Browse the repository at this point in the history
Signed-off-by: Jacob Choi <[email protected]>
  • Loading branch information
JacobCho-i committed Oct 14, 2023
1 parent afbbe11 commit 2ce04bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -967,11 +967,11 @@ class MonitorRestApiIT : AlertingRestTestCase() {
fun `test monitor stats when disabling and re-enabling scheduled jobs with existing monitor`() {
// Enable Monitor jobs

var response = enableScheduledJob()
enableScheduledJob()
val monitorId = createMonitor(randomQueryLevelMonitor(enabled = true), refresh = true).id

if (isMultiNode) OpenSearchTestCase.waitUntil({
return@waitUntil (response == null)
return@waitUntil false
}, 2, TimeUnit.SECONDS)
var alertingStats = getAlertingStats()
assertAlertingStatsSweeperEnabled(alertingStats, true)
Expand Down Expand Up @@ -1002,11 +1002,11 @@ class MonitorRestApiIT : AlertingRestTestCase() {
)

// Re-enable Monitor jobs
response = enableScheduledJob()
enableScheduledJob()

// Sleep briefly so sweep can reschedule the Monitor
OpenSearchTestCase.waitUntil({
return@waitUntil (response == null)
return@waitUntil false
}, 2, TimeUnit.SECONDS)

alertingStats = getAlertingStats()
Expand All @@ -1031,11 +1031,11 @@ class MonitorRestApiIT : AlertingRestTestCase() {
fun `test monitor stats jobs`() {
// Enable the Monitor plugin.

var response = enableScheduledJob()
enableScheduledJob()
createRandomMonitor(refresh = true)

if (isMultiNode) OpenSearchTestCase.waitUntil({
return@waitUntil (response == null)
return@waitUntil false
}, 2, TimeUnit.SECONDS)
val responseMap = getAlertingStats()
assertAlertingStatsSweeperEnabled(responseMap, true)
Expand Down Expand Up @@ -1066,11 +1066,11 @@ class MonitorRestApiIT : AlertingRestTestCase() {

fun `test monitor specific metric`() {
// Enable the Monitor plugin.
var response = enableScheduledJob()
enableScheduledJob()
createRandomMonitor(refresh = true)

if (isMultiNode) OpenSearchTestCase.waitUntil({
return@waitUntil (response == null)
return@waitUntil false
}, 2, TimeUnit.SECONDS)
val responseMap = getAlertingStats("/jobs_info")
assertAlertingStatsSweeperEnabled(responseMap, true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ class DestinationMigrationUtilServiceIT : AlertingRestTestCase() {
}

// Create cluster change event and wait for migration service to complete migrating data over
var request: Map<String, Any>? = null
request = client().updateSettings("indices.recovery.max_bytes_per_sec", "40mb")
client().updateSettings("indices.recovery.max_bytes_per_sec", "40mb")
OpenSearchTestCase.waitUntil({
return@waitUntil request == null
return@waitUntil false
}, 2, TimeUnit.MINUTES)

for (id in ids) {
Expand Down

0 comments on commit 2ce04bc

Please sign in to comment.