Skip to content

Commit

Permalink
Fix flaky GenericViewTest.toString (facebookincubator#9118)
Browse files Browse the repository at this point in the history
Summary:
`makeMapVectorFromJson` doesn't guarantee the order of the keys in the map
and causes flakiness in `GenericViewTest.toString`.

Verified by stress running the originally test 200 times.

Pull Request resolved: facebookincubator#9118

Reviewed By: pedroerp

Differential Revision: D55012894

Pulled By: mbasmanova

fbshipit-source-id: 37dda7cc00f0802081814c61e0419e637f052fca
  • Loading branch information
duanmeng authored and facebook-github-bot committed Mar 18, 2024
1 parent a092070 commit ac7f58f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions velox/expression/tests/GenericViewTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,15 +230,15 @@ TEST_F(GenericViewTest, toString) {

auto mapView = reader[0];
auto it = mapView.begin();
EXPECT_EQ(keys->toString(0), it->first.toString());
EXPECT_EQ(values->toString(0), it->second.value().toString());

++it;
EXPECT_EQ(keys->toString(1), it->first.toString());

++it;
EXPECT_EQ(keys->toString(2), it->first.toString());
EXPECT_EQ(values->toString(2), it->second.value().toString());
for (auto i = 0; i < 3; ++i) {
EXPECT_EQ(keys->toString(i), it->first.toString());
if (values->isNullAt(i)) {
EXPECT_FALSE(it->second.has_value());
} else {
EXPECT_EQ(values->toString(i), it->second->toString());
}
++it;
}
}
}

Expand Down

0 comments on commit ac7f58f

Please sign in to comment.