File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed
tests/functional/sqs/common Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -649,6 +649,8 @@ class TActionActor
649649 }
650650 }
651651
652+ Y_ABORT_UNLESS (SchemeCache_);
653+
652654 bool isACLProtectedAccount = Cfg ().GetForceAccessControl ();
653655 if (!IsCloud () && (SecurityToken_ || (Cfg ().GetForceAccessControl () && (isACLProtectedAccount = IsACLProtectedAccount (UserName_))))) {
654656 this ->Become (&TActionActor::WaitAuthCheckMessages);
@@ -666,8 +668,6 @@ class TActionActor
666668 return ;
667669 }
668670
669- Y_ABORT_UNLESS (SchemeCache_);
670-
671671 RequestSchemeCache (GetActionACLSourcePath ()); // this also checks that requested queue (if any) does exist
672672 RequestTicketParser ();
673673 } else {
Original file line number Diff line number Diff line change @@ -685,6 +685,7 @@ void TSqsService::AnswerThrottled(TSqsEvents::TEvGetConfiguration::TPtr& ev) {
685685 RLOG_SQS_REQ_DEBUG (ev->Get ()->RequestId , " Throttled because of too many requests for nonexistent queue [" << ev->Get ()->QueueName << " ] for user [" << ev->Get ()->UserName << " ] while getting configuration" );
686686 auto answer = MakeHolder<TSqsEvents::TEvConfiguration>();
687687 answer->Throttled = true ;
688+ answer->SchemeCache = SchemeCache_;
688689 Send (ev->Sender , answer.Release ());
689690}
690691
Original file line number Diff line number Diff line change 55from ydb .tests .library .sqs .test_base import KikimrSqsTestBase
66
77
8+ throttling_exception_pattern = ".*</Message><Code>ThrottlingException</Code>.*"
9+
810class TestSqsThrottlingOnNonexistentQueue (KikimrSqsTestBase ):
911
12+
1013 def test_throttling_on_nonexistent_queue (self ):
1114 queue_url = self ._create_queue_and_assert (self .queue_name , False , True )
1215 nonexistent_queue_url = queue_url + "_nonex"
@@ -21,8 +24,6 @@ def get_attributes_of_nonexistent_queue():
2124 except Exception :
2225 pass
2326
24- throttling_exception_pattern = ".*</Message><Code>ThrottlingException</Code>.*"
25-
2627 assert_that (
2728 get_attributes_of_nonexistent_queue ,
2829 raises (
@@ -46,3 +47,25 @@ def get_attributes_of_nonexistent_queue():
4647 pattern = throttling_exception_pattern
4748 )
4849 )
50+
51+ def test_action_which_does_not_requere_existing_queue (self ):
52+ queue_url = self ._create_queue_and_assert (self .queue_name , False , True )
53+ nonexistent_queue_url = queue_url + "_nonex"
54+
55+ def get_attributes_of_nonexistent_queue ():
56+ self ._sqs_api .get_queue_attributes (nonexistent_queue_url )
57+
58+ # Draining budget
59+ for _ in range (16 ):
60+ try :
61+ get_attributes_of_nonexistent_queue ()
62+ except Exception :
63+ pass
64+
65+ assert_that (
66+ lambda : self ._sqs_api .get_queue_url (self .queue_name + "_nonex" ),
67+ raises (
68+ RuntimeError ,
69+ pattern = throttling_exception_pattern
70+ )
71+ )
You can’t perform that action at this time.
0 commit comments