[UT][Bug] fix LOOP_LESS_OR_MORE (#5157)

This bug introduced by #5131. When AllowSlowTests() is true, we should loop more.
This commit is contained in:
HuangWei
2020-12-29 09:48:19 +08:00
committed by GitHub
parent 11c0aafa5c
commit 5e1a80bb22
2 changed files with 5 additions and 3 deletions

View File

@ -47,7 +47,9 @@ struct ColumnTest {
scoped_refptr<Column> newc;
ASSERT_TRUE(writer->finalize(2).ok());
ASSERT_TRUE(writer->get_new_column(&newc).ok());
if (!AllowSlowTests()) {
// The less `InsertCount` won't make COW performed,
// expect the new column object only when inserting more。
if (AllowSlowTests()) {
EXPECT_TRUE(c.get() != newc.get());
}
std::unique_ptr<ColumnReader> readc;
@ -76,7 +78,7 @@ struct ColumnTest {
scoped_refptr<Column> newc;
ASSERT_TRUE(writer->finalize(2).ok());
ASSERT_TRUE(writer->get_new_column(&newc).ok());
if (!AllowSlowTests()) {
if (AllowSlowTests()) {
EXPECT_TRUE(c.get() != newc.get());
}
std::unique_ptr<ColumnReader> readc;

View File

@ -19,7 +19,7 @@
namespace doris {
#define LOOP_LESS_OR_MORE(less, more) (AllowSlowTests() ? less : more)
#define LOOP_LESS_OR_MORE(less, more) (AllowSlowTests() ? more : less)
// Get the value of an environment variable that has boolean semantics.
bool GetBooleanEnvironmentVariable(const char* env_var_name);