Skip to content

Commit

Permalink
[test](move-memtable) fix false positives in sinkv2 injection tests (a…
Browse files Browse the repository at this point in the history
…pache#44552)

`test_writer_v2_fault_injection` did not assert Exception being thrown,
which caused false positives.
i.e. Code bugged but test passed.

This PR fixed this problem.
Run this test without apache#44344, it will now report errors as expected. 

```
2024-11-25 17:03:25.463 ERROR [non-concurrent-thread-1] (ScriptContext.groovy:122) - Run test_writer_v2_fault_injection in ./doris/regression-test/suites/fault_injection_p0/test_writer_v2_fault_injection.groovy failed
org.opentest4j.AssertionFailedError: expected Exception 'load timed out before close waiting', actual success ==> expected: <true> but was: <false>
```
  • Loading branch information
kaijchen committed Dec 9, 2024
1 parent b2637e4 commit a04e533
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,11 @@ suite("test_writer_v2_fault_injection", "nonConcurrent") {
file "baseall.txt"
}

def load_with_injection = { injection, error_msg->
def load_with_injection = { injection, error_msg, success=false->
try {
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),
Expand All @@ -88,7 +89,7 @@ suite("test_writer_v2_fault_injection", "nonConcurrent") {
// VTabletWriterV2 node_info is null
load_with_injection("VTabletWriterV2._open_streams_to_backend.node_info_null", "failed to open streams to any BE")
// VTabletWriterV2 do not get tablet schema on open_streams
load_with_injection("VTabletWriterV2._open_streams_to_backend.no_schema_when_open_streams", "success")
load_with_injection("VTabletWriterV2._open_streams_to_backend.no_schema_when_open_streams", "success", true)
// VTabletWriterV2 tablet_location is null
load_with_injection("VTabletWriterV2._build_tablet_node_mapping.tablet_location_null", "unknown tablet location")
// VTabletWriterV2 location is null
Expand Down

0 comments on commit a04e533

Please sign in to comment.