Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase SQS timeout in galley integration #3699

Merged
merged 2 commits into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/5-internal/increase-sqs-timeout
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Increase timeout for waiting for SQS notifications in galley's integration tests
4 changes: 2 additions & 2 deletions libs/types-common-aws/src/Util/Test/SQS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ waitForMessage watcher seconds predicate = timeout (seconds * 1_000_000) poll
(x : _) -> (delete x events, Just x)
maybe (threadDelay 10000 >> poll) pure matched

-- | First waits for a message matching a given predicate for 3 seconds (this
-- | First waits for a message matching a given predicate for 10 seconds (this
-- number could be chosen more scientifically) and then uses a callback to make
-- an assertion on such a message.
assertMessage :: (MonadUnliftIO m, Eq a, HasCallStack) => SQSWatcher a -> String -> (a -> Bool) -> (String -> Maybe a -> m ()) -> m ()
assertMessage watcher label predicate callback = do
matched <- waitForMessage watcher 3 predicate
matched <- waitForMessage watcher 10 predicate
callback label matched

-----------------------------------------------------------------------------
Expand Down