File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
packages/integration-tests/src/test-project-setup Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ---
Original file line number Diff line number Diff line change @@ -603,7 +603,7 @@ class DataStorageAuthWithTriggerTestProject extends TestProjectBase {
603
603
) => {
604
604
const TIMEOUT_MS = 1000 * 60 * 2 ; // 2 minutes
605
605
const startTime = Date . now ( ) ;
606
- let messageCount = 0 ;
606
+ let receivedMessageCount = 0 ;
607
607
608
608
const queue = await this . resourceFinder . findByBackendIdentifier (
609
609
backendId ,
@@ -612,16 +612,17 @@ class DataStorageAuthWithTriggerTestProject extends TestProjectBase {
612
612
) ;
613
613
614
614
// wait for schedule to invoke the function one time for it to send a message
615
- while ( Date . now ( ) - startTime < TIMEOUT_MS && messageCount < 1 ) {
615
+ while ( Date . now ( ) - startTime < TIMEOUT_MS ) {
616
616
const response = await this . sqsClient . send (
617
617
new ReceiveMessageCommand ( {
618
618
QueueUrl : queue [ 0 ] ,
619
619
WaitTimeSeconds : 20 ,
620
+ MaxNumberOfMessages : 10 ,
620
621
} )
621
622
) ;
622
623
623
624
if ( response . Messages ) {
624
- messageCount += response . Messages . length ;
625
+ receivedMessageCount += response . Messages . length ;
625
626
626
627
// delete messages afterwards
627
628
for ( const message of response . Messages ) {
@@ -634,5 +635,11 @@ class DataStorageAuthWithTriggerTestProject extends TestProjectBase {
634
635
}
635
636
}
636
637
}
638
+
639
+ if ( receivedMessageCount === 0 ) {
640
+ assert . fail (
641
+ `The scheduled function failed to invoke and send a message to the queue.`
642
+ ) ;
643
+ }
637
644
} ;
638
645
}
You can’t perform that action at this time.
0 commit comments