aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Borzenkov <snaury@gmail.com>2022-04-20 19:10:16 +0300
committerAlexey Borzenkov <snaury@gmail.com>2022-04-20 19:10:16 +0300
commitf77133f5e3571daf461ac4c08b7d64703a761294 (patch)
treed8b62d0e2bff8803aa9140c24630e4f2cb08be97
parent5b7ef1959c0611f575a20aedff2af617b20348b1 (diff)
downloadydb-f77133f5e3571daf461ac4c08b7d64703a761294.tar.gz
Fix flaky test in kqp, KIKIMR-14755
ref:787f5096b24c54ce4efe377248b9074b96746eb6
-rw-r--r--ydb/core/kqp/ut/kqp_mvcc_ut.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/ydb/core/kqp/ut/kqp_mvcc_ut.cpp b/ydb/core/kqp/ut/kqp_mvcc_ut.cpp
index 571b39df3a..f4b0ff951f 100644
--- a/ydb/core/kqp/ut/kqp_mvcc_ut.cpp
+++ b/ydb/core/kqp/ut/kqp_mvcc_ut.cpp
@@ -240,6 +240,11 @@ Y_UNIT_TEST_SUITE(KqpSnapshotRead) {
[[4000000001u];["BigOne"];[-1]]
])", FormatResultSetYson(result.GetResultSet(0)));
+ // We need to sleep before the upsert below, otherwise writes
+ // might happen in the same step as the snapshot, which would be
+ // treated as happening before snapshot and will not break any locks.
+ Sleep(TDuration::Seconds(2));
+
result = session2.ExecuteDataQuery(Q_(R"(
UPSERT INTO `/Root/EightShard` (Key, Text) VALUES (101u, "SomeText");
)"), TTxControl::BeginTx(TTxSettings::SerializableRW()).CommitTx()).ExtractValueSync();