Skip to content

Commit

Permalink
branch-3.0: [test](move-memtable) mitigate flaky injection test `skip…
Browse files Browse the repository at this point in the history
…_two_backends` #47082 (#47110)

Cherry-picked from #47082

Co-authored-by: Kaijie Chen <[email protected]>
  • Loading branch information
github-actions[bot] and kaijchen authored Jan 31, 2025
1 parent 3231215 commit 6ae85be
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,16 @@ suite("test_multi_replica_fault_injection", "nonConcurrent") {
file "baseall.txt"
}

def load_with_injection = { injection, error_msg, success=false->
def load_with_injection = { injection, error_msg, success=false, alt_error_msg=null->
try {
sql "truncate table test"
GetDebugPoint().enableDebugPointForAllBEs(injection)
sql "insert into test select * from baseall where k1 <= 3"
assertTrue(success, String.format("Expected Exception '%s', actual success", error_msg))
} catch(Exception e) {
logger.info(e.getMessage())
assertTrue(e.getMessage().contains(error_msg), e.toString())
boolean e_contains_alt_error_msg = (alt_error_msg != null && e.getMessage().contains(alt_error_msg))
assertTrue(e.getMessage().contains(error_msg) || e_contains_alt_error_msg, e.toString())
} finally {
GetDebugPoint().disableDebugPointForAllBEs(injection)
}
Expand All @@ -101,7 +102,7 @@ suite("test_multi_replica_fault_injection", "nonConcurrent") {
// test one backend open failure
load_with_injection("VTabletWriterV2._open_streams.skip_one_backend", "success", true)
// test two backend open failure
load_with_injection("VTabletWriterV2._open_streams.skip_two_backends", "not enough streams 1/3")
load_with_injection("VTabletWriterV2._open_streams.skip_two_backends", "not enough streams 1/3", false, "succ replica num 1 < load required replica num 2")
sql """ set enable_memtable_on_sink_node=false """
}
}

0 comments on commit 6ae85be

Please sign in to comment.