@@ -698,8 +698,10 @@ Y_UNIT_TEST_SUITE(KqpScripting) {
698
698
auto expected = TString (" [" ) + EXPECTED_EIGHTSHARD_VALUE1 + " ]" ;
699
699
700
700
int unsuccessStatus = 0 ;
701
+ int successResults = 0 ;
702
+ constexpr int delta = NSan::PlainOrUnderSanitizer (1 , 3 );
701
703
702
- for (int i = 1 ; i < maxTimeoutMs; i++ ) {
704
+ for (int i = 1 ; i < maxTimeoutMs; i += delta ) {
703
705
auto it = client.StreamExecuteYqlScript (R"(
704
706
SELECT * FROM `/Root/EightShard` WHERE Text = "Value1" ORDER BY Key;
705
707
)" , getExecuteYqlRequestSettings (i)).GetValueSync ();
@@ -708,6 +710,11 @@ Y_UNIT_TEST_SUITE(KqpScripting) {
708
710
try {
709
711
auto yson = StreamResultToYson (it, true );
710
712
CompareYson (expected, yson);
713
+ ++successResults;
714
+ if (successResults == 3 ) {
715
+ break ;
716
+ }
717
+
711
718
} catch (const TStreamReadError& ex) {
712
719
unsuccessStatus++;
713
720
if (ex.Status != NYdb::EStatus::CLIENT_DEADLINE_EXCEEDED && ex.Status != NYdb::EStatus::TIMEOUT) {
@@ -736,14 +743,22 @@ Y_UNIT_TEST_SUITE(KqpScripting) {
736
743
int maxTimeoutMs = 1000 ;
737
744
738
745
auto getExecuteYqlRequestSettings = GetExecuteYqlRequestSettingsFn (clientTimeout, operationTimeout);
746
+ int successResults = 0 ;
739
747
740
- for (int i = 1 ; i < maxTimeoutMs; i++) {
748
+ constexpr int delta = NSan::PlainOrUnderSanitizer (1 , 3 );
749
+
750
+ for (int i = 1 ; i < maxTimeoutMs; i += delta) {
741
751
auto result = client.ExecuteYqlScript (R"(
742
752
SELECT * FROM `/Root/EightShard` WHERE Text = "Value1" ORDER BY Key;
743
753
)" , getExecuteYqlRequestSettings (i)).GetValueSync ();
744
754
745
755
if (result.IsSuccess ()) {
746
756
CompareYson (EXPECTED_EIGHTSHARD_VALUE1, FormatResultSetYson (result.GetResultSet (0 )));
757
+ successResults++;
758
+ if (successResults == 3 ) {
759
+ break ;
760
+ }
761
+
747
762
} else {
748
763
switch (result.GetStatus ()) {
749
764
case NYdb::EStatus::CLIENT_DEADLINE_EXCEEDED:
@@ -771,7 +786,10 @@ Y_UNIT_TEST_SUITE(KqpScripting) {
771
786
772
787
auto expected = TString (" [" ) + EXPECTED_EIGHTSHARD_VALUE1 + " ]" ;
773
788
774
- for (int i = 1 ; i < maxTimeoutMs; i++) {
789
+ constexpr int delta = NSan::PlainOrUnderSanitizer (1 , 5 );
790
+ int successResults = 0 ;
791
+
792
+ for (int i = 1 ; i < maxTimeoutMs; i += delta) {
775
793
auto it = client.StreamExecuteYqlScript (R"(
776
794
SELECT * FROM `/Root/EightShard` WHERE Text = "Value1" ORDER BY Key;
777
795
)" , TExecuteYqlRequestSettings ().CancelAfter (TDuration::MilliSeconds (i))).GetValueSync ();
@@ -780,6 +798,11 @@ Y_UNIT_TEST_SUITE(KqpScripting) {
780
798
try {
781
799
auto yson = StreamResultToYson (it, true );
782
800
CompareYson (expected, yson);
801
+ ++successResults;
802
+ if (successResults == 3 ) {
803
+ break ;
804
+ }
805
+
783
806
} catch (const TStreamReadError& ex) {
784
807
if (ex.Status != NYdb::EStatus::CANCELLED) {
785
808
TStringStream msg;
@@ -813,8 +836,9 @@ Y_UNIT_TEST_SUITE(KqpScripting) {
813
836
};
814
837
815
838
TString expected;
839
+ const int delta = NSan::PlainOrUnderSanitizer (1 , 5 );
816
840
817
- for (int i = 1 ; i <= maxTimeoutMs; i++ ) {
841
+ for (int i = 1 ; i <= maxTimeoutMs; i += delta ) {
818
842
auto it = client.StreamExecuteYqlScript (Sprintf (R"(
819
843
UPSERT INTO `/Root/EightShard` (Key, Data, Text) VALUES (%lu, 100500, "newrecords");
820
844
COMMIT;
@@ -860,9 +884,10 @@ Y_UNIT_TEST_SUITE(KqpScripting) {
860
884
return Sprintf (R"( [[100500];[%luu];["newrecords"]])" , key);
861
885
};
862
886
887
+ constexpr int delta = NSan::PlainOrUnderSanitizer (1 , 5 );
863
888
TString expected;
864
889
865
- for (int i = 1 ; i <= maxTimeoutMs; i++ ) {
890
+ for (int i = 1 ; i <= maxTimeoutMs; i += delta ) {
866
891
auto result = client.ExecuteYqlScript (Sprintf (R"(
867
892
UPSERT INTO `/Root/EightShard` (Key, Data, Text) VALUES (%lu, 100500, "newrecords");
868
893
COMMIT;
0 commit comments