Skip to content

Commit

Permalink
[opt](test) Make the case stable. (#44195)
Browse files Browse the repository at this point in the history
Problem Summary:
Make the regression case stable
  • Loading branch information
csun5285 authored Nov 20, 2024
1 parent 6c573d6 commit f5daeb5
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import org.codehaus.groovy.runtime.IOGroovyMethods

suite("test_single_compaction_with_variant_inverted", "p2") {
suite("test_single_compaction_with_variant_inverted", "p2, nonConcurrent") {
if (isCloudMode()) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ suite("test_variant_bloom_filter", "nonConcurrent") {
getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort);
def tablets = sql_return_maparray """ show tablets from ${index_table}; """

int beforeSegmentCount = 0

for (def tablet in tablets) {
int beforeSegmentCount = 0
String tablet_id = tablet.TabletId
(code, out, err) = curl("GET", tablet.CompactionStatus)
logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err)
Expand All @@ -83,8 +84,8 @@ suite("test_variant_bloom_filter", "nonConcurrent") {
for (String rowset in (List<String>) tabletJson.rowsets) {
beforeSegmentCount += Integer.parseInt(rowset.split(" ")[1])
}
assertEquals(beforeSegmentCount, 5)
}
assertEquals(beforeSegmentCount, 5)

// trigger compactions for all tablets in ${tableName}
for (def tablet in tablets) {
Expand All @@ -111,8 +112,8 @@ suite("test_variant_bloom_filter", "nonConcurrent") {
});
}

int afterSegmentCount = 0
for (def tablet in tablets) {
int afterSegmentCount = 0
String tablet_id = tablet.TabletId
(code, out, err) = curl("GET", tablet.CompactionStatus)
logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err)
Expand All @@ -123,8 +124,9 @@ suite("test_variant_bloom_filter", "nonConcurrent") {
logger.info("rowset is: " + rowset)
afterSegmentCount += Integer.parseInt(rowset.split(" ")[1])
}
assertEquals(afterSegmentCount, 1)
}
assertEquals(afterSegmentCount, 1)


try {
GetDebugPoint().enableDebugPointForAllBEs("bloom_filter_must_filter_data")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ suite("test_index_compaction_p0", "p0, nonConcurrent") {
(1..20).each { i ->
def fileName = "documents-" + i + ".json"
load_json_data.call(compaction_table_name, """${fileName}""")

}

def backendId_to_backendIP = [:]
Expand All @@ -91,8 +90,9 @@ suite("test_index_compaction_p0", "p0, nonConcurrent") {
//TabletId,ReplicaId,BackendId,SchemaHash,Version,LstSuccessVersion,LstFailedVersion,LstFailedTime,LocalDataSize,RemoteDataSize,RowCount,State,LstConsistencyCheckTime,CheckVersion,VersionCount,QueryHits,PathHash,MetaUrl,CompactionStatus
def tablets = sql_return_maparray """ show tablets from ${compaction_table_name}; """

int beforeSegmentCount = 0

for (def tablet in tablets) {
int beforeSegmentCount = 0
String tablet_id = tablet.TabletId
(code, out, err) = curl("GET", tablet.CompactionStatus)
logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err)
Expand All @@ -102,14 +102,14 @@ suite("test_index_compaction_p0", "p0, nonConcurrent") {
for (String rowset in (List<String>) tabletJson.rowsets) {
beforeSegmentCount += Integer.parseInt(rowset.split(" ")[1])
}
assertEquals(beforeSegmentCount, 20)
}
assertEquals(beforeSegmentCount, 20)

// trigger compactions for all tablets in ${tableName}
for (def tablet in tablets) {
String tablet_id = tablet.TabletId
backend_id = tablet.BackendId
(code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id)
(code, out, err) = be_run_full_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id)
logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err)
assertEquals(code, 0)
def compactJson = parseJson(out.trim())
Expand All @@ -130,8 +130,9 @@ suite("test_index_compaction_p0", "p0, nonConcurrent") {
});
}

int afterSegmentCount = 0

for (def tablet in tablets) {
int afterSegmentCount = 0
String tablet_id = tablet.TabletId
(code, out, err) = curl("GET", tablet.CompactionStatus)
logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err)
Expand All @@ -142,6 +143,7 @@ suite("test_index_compaction_p0", "p0, nonConcurrent") {
logger.info("rowset is: " + rowset)
afterSegmentCount += Integer.parseInt(rowset.split(" ")[1])
}
assertEquals(afterSegmentCount, 1)
}
assertEquals(afterSegmentCount, 1)

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// under the License.
import org.codehaus.groovy.runtime.IOGroovyMethods

suite("test_insert_with_index", "p0") {
suite("test_insert_with_index", "p0, nonConcurrent") {

def set_be_config = { key, value ->
def backendId_to_backendIP = [:]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// under the License.
import org.codehaus.groovy.runtime.IOGroovyMethods

suite("test_stream_load_with_inverted_index_p0", "p0") {
suite("test_stream_load_with_inverted_index_p0", "p0, nonConcurrent") {

def set_be_config = { key, value ->
def backendId_to_backendIP = [:]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ suite("test_index_compaction_p1", "p1, nonConcurrent") {
//TabletId,ReplicaId,BackendId,SchemaHash,Version,LstSuccessVersion,LstFailedVersion,LstFailedTime,LocalDataSize,RemoteDataSize,RowCount,State,LstConsistencyCheckTime,CheckVersion,VersionCount,QueryHits,PathHash,MetaUrl,CompactionStatus
def tablets = sql_return_maparray """ show tablets from ${compaction_table_name}; """

int beforeSegmentCount = 0

for (def tablet in tablets) {
int beforeSegmentCount = 0
String tablet_id = tablet.TabletId
(code, out, err) = curl("GET", tablet.CompactionStatus)
logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err)
Expand All @@ -106,14 +107,14 @@ suite("test_index_compaction_p1", "p1, nonConcurrent") {
for (String rowset in (List<String>) tabletJson.rowsets) {
beforeSegmentCount += Integer.parseInt(rowset.split(" ")[1])
}
assertEquals(beforeSegmentCount, 110)
}
assertEquals(beforeSegmentCount, 110)

// trigger compactions for all tablets in ${tableName}
for (def tablet in tablets) {
String tablet_id = tablet.TabletId
backend_id = tablet.BackendId
(code, out, err) = be_run_cumulative_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id)
(code, out, err) = be_run_full_compaction(backendId_to_backendIP.get(backend_id), backendId_to_backendHttpPort.get(backend_id), tablet_id)
logger.info("Run compaction: code=" + code + ", out=" + out + ", err=" + err)
assertEquals(code, 0)
def compactJson = parseJson(out.trim())
Expand All @@ -134,8 +135,8 @@ suite("test_index_compaction_p1", "p1, nonConcurrent") {
});
}

int afterSegmentCount = 0
for (def tablet in tablets) {
int afterSegmentCount = 0
String tablet_id = tablet.TabletId
(code, out, err) = curl("GET", tablet.CompactionStatus)
logger.info("Show tablets status: code=" + code + ", out=" + out + ", err=" + err)
Expand All @@ -146,6 +147,6 @@ suite("test_index_compaction_p1", "p1, nonConcurrent") {
logger.info("rowset is: " + rowset)
afterSegmentCount += Integer.parseInt(rowset.split(" ")[1])
}
assertEquals(afterSegmentCount, 1)
}
assertEquals(afterSegmentCount, 1)
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

suite("test_variant_index_format_v1", "p2") {
suite("test_variant_index_format_v1", "p2, nonConcurrent") {
def calc_file_crc_on_tablet = { ip, port, tablet ->
return curl("GET", String.format("http://%s:%s/api/calc_crc?tablet_id=%s", ip, port, tablet))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// /testing/trino-product-tests/src/main/resources/sql-tests/testcases
// and modified by Doris.

suite("test_single_replica_load", "p2") {
suite("test_single_replica_load", "p2, nonConcurrent") {

def load_json_data = {table_name, file_name ->
// load the json data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// specific language governing permissions and limitations
// under the License.

suite("regression_test_variant_var_index", "p0"){
suite("regression_test_variant_var_index", "p0, nonConcurrent"){
def table_name = "var_index"
sql "DROP TABLE IF EXISTS var_index"
sql """
Expand Down

0 comments on commit f5daeb5

Please sign in to comment.