Skip to content

Commit

Permalink
Removes rc1 qualifier (#353) (#359)
Browse files Browse the repository at this point in the history
* Removes rc1 qualifier

Signed-off-by: Clay Downs <downsrob@amazon.com>

* Allows error in shrink test

Signed-off-by: Clay Downs <downsrob@amazon.com>
(cherry picked from commit 5df46d5)

Co-authored-by: Clay Downs <downsrob@amazon.com>
  • Loading branch information
opensearch-trigger-bot[bot] and downsrob committed May 12, 2022
1 parent de4ee83 commit b4764ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import java.util.function.Predicate
buildscript {
ext {
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
opensearch_version = System.getProperty("opensearch.version", "2.0.0-rc1-SNAPSHOT")
buildVersionQualifier = System.getProperty("build.version_qualifier", "rc1")
// 2.0.0-rc1-SNAPSHOT -> 2.0.0.0-rc1-SNAPSHOT
opensearch_version = System.getProperty("opensearch.version", "2.0.0-SNAPSHOT")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
// 2.0.0-SNAPSHOT -> 2.0.0.0-SNAPSHOT
version_tokens = opensearch_version.tokenize('-')
opensearch_build = version_tokens[0] + '.0'
job_scheduler_no_snapshot = opensearch_build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import org.opensearch.indexmanagement.spi.indexstatemanagement.model.ActionTimeo
import org.opensearch.test.OpenSearchTestCase
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.lang.Math.abs
import kotlin.test.assertFailsWith

class ActionTests : OpenSearchTestCase() {
Expand Down Expand Up @@ -191,7 +192,9 @@ class ActionTests : OpenSearchTestCase() {
val totalNodeBytes = randomByteSizeValue().bytes
val thresholdBytes = getFreeBytesThresholdHigh(clusterSettings, totalNodeBytes)
val expectedThreshold: Long = ((1 - (rawPercentage.toDouble() / 100.0)) * totalNodeBytes).toLong()
assertEquals("Free bytes threshold not being calculated correctly for percentage setting.", thresholdBytes, expectedThreshold)
// To account for some rounding issues, allow an error of 1
val approximatelyEqual = kotlin.math.abs(thresholdBytes - expectedThreshold) <= 1
assertTrue("Free bytes threshold not being calculated correctly for percentage setting.", approximatelyEqual)
}

fun `test shrink disk threshold byte settings`() {
Expand Down

0 comments on commit b4764ec

Please sign in to comment.