@@ -647,9 +647,19 @@ void CmdSetExecutorFastLogPolicy(bool isAllowed, TTestContext &tc) {
647
647
// NEW SINGLE COMMAND TEST FUNCTIONS
648
648
// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
649
649
650
+ template <typename T>
651
+ struct NotEq {
652
+ T Value;
653
+
654
+ bool Check (const T &value) const {
655
+ return Value != value;
656
+ }
657
+ };
658
+
650
659
struct TKeyValuePair {
651
660
TString Key;
652
661
TString Value;
662
+ std::variant<std::monostate, ui64, NotEq<ui64>> CreationUnixTime = std::monostate();
653
663
};
654
664
655
665
template <typename TRequestEvent>
@@ -698,7 +708,7 @@ void SendWrite(TTestContext &tc, const TDeque<TKeyValuePair> &pairs, ui64 locked
698
708
{
699
709
NKikimrKeyValue::ExecuteTransactionRequest et;
700
710
701
- for (auto &[key, value] : pairs) {
711
+ for (auto &[key, value, creationUnixTime ] : pairs) {
702
712
NKikimrKeyValue::ExecuteTransactionRequest::Command *cmd = et.add_commands ();
703
713
NKikimrKeyValue::ExecuteTransactionRequest::Command::Write *write = cmd->mutable_write ();
704
714
@@ -720,7 +730,7 @@ void ExecuteWrite(TTestContext &tc, const TDeque<TKeyValuePair> &pairs, ui64 loc
720
730
{
721
731
TDesiredPair<TEvKeyValue::TEvExecuteTransaction> dp;
722
732
723
- for (auto &[key, value] : pairs) {
733
+ for (auto &[key, value, creationUnixTime ] : pairs) {
724
734
NKikimrKeyValue::ExecuteTransactionRequest::Command *cmd = dp.Request .add_commands ();
725
735
NKikimrKeyValue::ExecuteTransactionRequest::Command::Write *write = cmd->mutable_write ();
726
736
@@ -990,6 +1000,12 @@ void ExecuteReadRange(TTestContext &tc,
990
1000
<< " msg# " << dp.Response .msg ());
991
1001
UNIT_ASSERT_VALUES_EQUAL_C (pair.key (), expectedPairs[idx].Key , " msg# " << dp.Response .msg ());
992
1002
UNIT_ASSERT_VALUES_EQUAL_C (pair.value (), expectedPairs[idx].Value , " msg# " << dp.Response .msg ());
1003
+
1004
+ if (std::holds_alternative<ui64>(expectedPairs[idx].CreationUnixTime )) {
1005
+ UNIT_ASSERT_VALUES_EQUAL_C (pair.creation_unix_time (), std::get<ui64>(expectedPairs[idx].CreationUnixTime ), " msg# " << dp.Response .msg ());
1006
+ } else if (std::holds_alternative<NotEq<ui64>>(expectedPairs[idx].CreationUnixTime )) {
1007
+ UNIT_ASSERT_VALUES_UNEQUAL_C (pair.creation_unix_time (), std::get<NotEq<ui64>>(expectedPairs[idx].CreationUnixTime ).Value , " msg# " << dp.Response .msg ());
1008
+ }
993
1009
}
994
1010
}
995
1011
}
@@ -2818,6 +2834,35 @@ Y_UNIT_TEST(TestWriteAndRenameWithCreationUnixTime)
2818
2834
tc);
2819
2835
}
2820
2836
2837
+
2838
+
2839
+ Y_UNIT_TEST (TestWriteAndRenameWithoutCreationUnixTimeNewApi)
2840
+ {
2841
+ TTestContext tc;
2842
+ TFinalizer finalizer (tc);
2843
+ bool activeZone = false ;
2844
+ tc.Prepare (INITIAL_TEST_DISPATCH_NAME, [](TTestActorRuntime &runtime){
2845
+ runtime.UpdateCurrentTime (TInstant::Zero () + TDuration::Seconds (1000 ));
2846
+ }, activeZone);
2847
+
2848
+ ExecuteWrite (tc, {{" key-1" , " value" }}, 0 , 1 , NKikimrKeyValue::Priorities::PRIORITY_REALTIME);
2849
+
2850
+ ExecuteReadRange (tc,
2851
+ {" key-1" }, EBorderKind::Include,
2852
+ " key-1" , EBorderKind::Include,
2853
+ {{" key-1" , " value" , NotEq<ui64>{0 }}},
2854
+ 0 , true , 65000 );
2855
+
2856
+ ExecuteRename (tc, {{" key-1" , " key-2" }}, 0 );
2857
+
2858
+ ExecuteReadRange (tc,
2859
+ {" key-2" }, EBorderKind::Include,
2860
+ " key-2" , EBorderKind::Include,
2861
+ {{" key-2" , " value" , NotEq<ui64>{0 }}},
2862
+ 0 , true , 65000 );
2863
+ }
2864
+
2865
+
2821
2866
Y_UNIT_TEST (TestReadRequestInFlightLimit)
2822
2867
{
2823
2868
TTestContext tc;
0 commit comments