[ 
https://issues.apache.org/jira/browse/CAMEL-23761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18113885#comment-18113885
 ] 

Guillaume Nodet commented on CAMEL-23761:
-----------------------------------------

I reviewed the camel-aws2-sqs code for the delay queue behavior.

A few questions/observations that could help pinpoint the root cause:

*1. What does the full SqsProducerDelayedQueueIT test look like?*
The test was created on the branch 
https://github.com/apupier/camel/tree/23761-sqsDelayedQueue and does not exist 
in the main Camel repository. Could you share or link the complete test source? 
In particular, the assertion at line 51 that checks `actual: 2L >= 20L` — is it 
checking the SQS queue attribute DELAY_SECONDS, or the count of received 
messages, or something else?

*2. What is the source of the value 2?*
SQS queue DELAY_SECONDS defaults to 0 when not set, so `2` is an unexpected 
value. Possible causes:
- A queue with `DELAY_SECONDS=2` already existed in Localstack from a prior 
test run (test isolation / no cleanup between runs)
- The test URI uses `delaySeconds=20` but there is a typo or misconfiguration 
somewhere
- The test assertion is checking a different attribute or metric

*3. Localstack / test setup:*
What version of Localstack are you using? How is the SQS queue URL constructed 
in your IT test? Is the queue deleted and recreated between test runs?

The current Camel code in `Sqs2Endpoint.java` adds `DELAY_SECONDS` to both 
`createQueue` and `updateQueueAttributes` when `delayQueue=true` and 
`delaySeconds` is set, so the code path looks correct. Without the full test 
source and setup details it is difficult to determine whether this is a Camel 
bug or a test design issue.

_Note: This comment was generated by an AI coding agent on behalf of gnodet and 
requires manual verification._

> SqsProducerDelayedQueueIT.delayedQueue is failing
> -------------------------------------------------
>
>                 Key: CAMEL-23761
>                 URL: https://issues.apache.org/jira/browse/CAMEL-23761
>             Project: Camel
>          Issue Type: Test
>          Components: camel-aws2-sqs
>    Affects Versions: 4.20.0
>            Reporter: Aurélien Pupier
>            Priority: Minor
>
> it is initally a test on spring boot side.
> ```
> org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
>       at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:190)
>       at 
> org.apache.camel.component.aws2.sqs.SqsDelayedQueueTest.delayedQueue(SqsDelayedQueueTest.java:69)
> ```
> I recreated the test on Camel core side on this branch 
> https://github.com/apupier/camel/tree/23761-sqsDelayedQueue and the same 
> error occurs:
> {noformat}
> [ERROR] Tests run: 1, Failures: 
> 1, Errors: 0, Skipped: 0, Time elapsed: 2.051 s <<< 
> FAILURE! -- in 
> org.apache.camel.component.aws2.sqs.integration.SqsProducerDelayedQueueIT
> [ERROR] 
> org.apache.camel.component.aws2.sqs.integration.SqsProducerDelayedQueueIT.delayedQueue
>  -- Time elapsed: 2.045 s <<< FAILURE!
> java.lang.AssertionError: 
> Expecting actual:
>   2L
> to be greater than or equal to:
>   20L
>       at 
> org.apache.camel.component.aws2.sqs.integration.SqsProducerDelayedQueueIT.delayedQueue(SqsProducerDelayedQueueIT.java:51)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to