chatwoot/spec/support
Sojan Jose c31325e982
fix: resolve mutex conflicts in Instagram webhook specs (#12154)
This PR fixes flaky test failures in the Instagram webhook specs that
were caused by Redis mutex lock conflicts when
   tests ran in parallel.

 ### The Problem:
The InstagramEventsJob uses a Redis mutex with a key based on sender_id
and ig_account_id to prevent race
conditions. However, all test factories were using the same hardcoded
sender_id: 'Sender-id-1', causing multiple
test instances to compete for the same mutex lock when running in
parallel.

 ### The Solution:
- Updated all Instagram event factories to generate unique sender IDs
using SecureRandom.hex(4)
- Modified test stubs and expectations to work with dynamic sender IDs
instead of hardcoded values
- Ensured each test instance gets its own unique mutex key, eliminating
lock contention
2025-08-11 23:31:25 +05:30
..
csv_spec_helpers.rb chore: Contact import improvements (CW-1362) (#6747) 2023-04-18 00:40:55 +05:30
file_upload_helpers.rb fix: check the content type for the file when uploading from cloud storage (#5378) 2022-10-21 18:05:36 -07:00
instagram_spec_helpers.rb fix: resolve mutex conflicts in Instagram webhook specs (#12154) 2025-08-11 23:31:25 +05:30
negated_matchers.rb Find by downcased email in SupportMailbox (#5211) 2022-10-12 13:38:18 +05:30
slack_stubs.rb feat: Slack link unfurling (#7940) 2023-09-29 19:35:56 +05:30