File tree 3 files changed +27
-4
lines changed
tests/functional/sqs/common
3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -649,6 +649,8 @@ class TActionActor
649
649
}
650
650
}
651
651
652
+ Y_ABORT_UNLESS (SchemeCache_);
653
+
652
654
bool isACLProtectedAccount = Cfg ().GetForceAccessControl ();
653
655
if (!IsCloud () && (SecurityToken_ || (Cfg ().GetForceAccessControl () && (isACLProtectedAccount = IsACLProtectedAccount (UserName_))))) {
654
656
this ->Become (&TActionActor::WaitAuthCheckMessages);
@@ -666,8 +668,6 @@ class TActionActor
666
668
return ;
667
669
}
668
670
669
- Y_ABORT_UNLESS (SchemeCache_);
670
-
671
671
RequestSchemeCache (GetActionACLSourcePath ()); // this also checks that requested queue (if any) does exist
672
672
RequestTicketParser ();
673
673
} else {
Original file line number Diff line number Diff line change @@ -685,6 +685,7 @@ void TSqsService::AnswerThrottled(TSqsEvents::TEvGetConfiguration::TPtr& ev) {
685
685
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" );
686
686
auto answer = MakeHolder<TSqsEvents::TEvConfiguration>();
687
687
answer->Throttled = true ;
688
+ answer->SchemeCache = SchemeCache_;
688
689
Send (ev->Sender , answer.Release ());
689
690
}
690
691
Original file line number Diff line number Diff line change 4
4
5
5
from ydb .tests .library .sqs .test_base import KikimrSqsTestBase
6
6
7
+ throttling_exception_pattern = ".*</Message><Code>ThrottlingException</Code>.*"
8
+
7
9
8
10
class TestSqsThrottlingOnNonexistentQueue (KikimrSqsTestBase ):
9
11
@@ -21,8 +23,6 @@ def get_attributes_of_nonexistent_queue():
21
23
except Exception :
22
24
pass
23
25
24
- throttling_exception_pattern = ".*</Message><Code>ThrottlingException</Code>.*"
25
-
26
26
assert_that (
27
27
get_attributes_of_nonexistent_queue ,
28
28
raises (
@@ -46,3 +46,25 @@ def get_attributes_of_nonexistent_queue():
46
46
pattern = throttling_exception_pattern
47
47
)
48
48
)
49
+
50
+ def test_action_which_does_not_requere_existing_queue (self ):
51
+ queue_url = self ._create_queue_and_assert (self .queue_name , False , True )
52
+ nonexistent_queue_url = queue_url + "_nonex"
53
+
54
+ def get_attributes_of_nonexistent_queue ():
55
+ self ._sqs_api .get_queue_attributes (nonexistent_queue_url )
56
+
57
+ # Draining budget
58
+ for _ in range (16 ):
59
+ try :
60
+ get_attributes_of_nonexistent_queue ()
61
+ except Exception :
62
+ pass
63
+
64
+ assert_that (
65
+ lambda : self ._sqs_api .get_queue_url (self .queue_name + "_nonex" ),
66
+ raises (
67
+ RuntimeError ,
68
+ pattern = throttling_exception_pattern
69
+ )
70
+ )
You can’t perform that action at this time.
0 commit comments