@@ -2907,6 +2907,26 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) {
2907
2907
runtime.DispatchEvents (options);
2908
2908
};
2909
2909
2910
+ auto createTable = [&]() {
2911
+ TestCreateTable (runtime, ++txId, " /MyRoot/USER_0" , R"(
2912
+ Name: "Table1"
2913
+ Columns { Name: "key" Type: "Uint32"}
2914
+ Columns { Name: "value" Type: "Utf8"}
2915
+ KeyColumnNames: ["key"]
2916
+ )" , {NKikimrScheme::StatusAccepted});
2917
+ env.TestWaitNotification (runtime, txId);
2918
+ };
2919
+
2920
+ auto checkQuotaAndDropTable = [&]() {
2921
+ TestDescribeResult (DescribePath (runtime, " /MyRoot/USER_0" ), {LsCheckDiskQuotaExceeded (true , " Table was created and data was written" )});
2922
+
2923
+ TestDropTable (runtime, ++txId, " /MyRoot/USER_0" , " Table1" );
2924
+ waitForSchemaChanged (1 );
2925
+ env.TestWaitNotification (runtime, txId);
2926
+
2927
+ TestDescribeResult (DescribePath (runtime, " /MyRoot/USER_0" ), {LsCheckDiskQuotaExceeded (false , " Table dropped" )});
2928
+ };
2929
+
2910
2930
// Subdomain with a 1-byte data size quota
2911
2931
TestCreateSubDomain (runtime, ++txId, " /MyRoot" , R"(
2912
2932
Name: "USER_0"
@@ -2931,29 +2951,30 @@ Y_UNIT_TEST_SUITE(TSchemeShardSubDomainTest) {
2931
2951
TestDescribeResult (DescribePath (runtime, " /MyRoot/USER_0" ),
2932
2952
{LsCheckDiskQuotaExceeded (false , " SubDomain created" )});
2933
2953
2934
- // skip a single coordinator and mediator
2935
- ui64 tabletId = TTestTxConfig::FakeHiveTablets + 2 ;
2954
+ // UpdateRow
2955
+ {
2956
+ createTable ();
2936
2957
2937
- TestCreateTable (runtime, ++txId, " /MyRoot/USER_0" , R"(
2938
- Name: "Table1"
2939
- Columns { Name: "key" Type: "Uint32"}
2940
- Columns { Name: "value" Type: "Utf8"}
2941
- KeyColumnNames: ["key"]
2942
- )" , {NKikimrScheme::StatusAccepted});
2943
- env.TestWaitNotification (runtime, txId);
2958
+ ui64 tabletId = TTestTxConfig::FakeHiveTablets + 2 ; // skip a single coordinator and mediator
2959
+ UpdateRow (runtime, " Table1" , 1 , " value1" , tabletId);
2960
+ waitForTableStats (1 );
2944
2961
2945
- UpdateRow (runtime, " Table1 " , 1 , " value1 " , tabletId );
2946
- waitForTableStats ( 1 );
2962
+ checkQuotaAndDropTable ( );
2963
+ }
2947
2964
2948
- TestDescribeResult (DescribePath (runtime, " /MyRoot/USER_0" ),
2949
- {LsCheckDiskQuotaExceeded (true , " Table was created and data was written" )});
2965
+ // WriteRow
2966
+ {
2967
+ createTable ();
2950
2968
2951
- TestDropTable (runtime, ++txId, " /MyRoot/USER_0 " , " Table1 " ) ;
2952
- waitForSchemaChanged ( 1 );
2953
- env. TestWaitNotification (runtime, txId );
2969
+ bool successIsExpected = true ;
2970
+ WriteRow (runtime, ++txId, " /MyRoot/USER_0/Table1 " , 0 , 1 , " value1 " , successIsExpected );
2971
+ waitForTableStats ( 1 );
2954
2972
2955
- TestDescribeResult (DescribePath (runtime, " /MyRoot/USER_0" ),
2956
- {LsCheckDiskQuotaExceeded (false , " Table dropped" )});
2973
+ successIsExpected = false ;
2974
+ WriteRow (runtime, ++txId, " /MyRoot/USER_0/Table1" , 0 , 1 , " value1" , successIsExpected);
2975
+
2976
+ checkQuotaAndDropTable ();
2977
+ }
2957
2978
}
2958
2979
2959
2980
Y_UNIT_TEST (SchemeDatabaseQuotaRejects) {
0 commit comments