mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-30 02:32:29 +00:00
fix: isolate race condition test by filtering jobs for specific conversation
The test was checking total ConversationReplyEmailWorker.jobs.size which accumulates across the entire test suite in CI, causing false failures. Now filters jobs by conversation_id to only count workers for the specific conversation under test.
This commit is contained in:
@@ -74,7 +74,8 @@ describe Messages::SendEmailNotificationService do
|
||||
threads.each(&:join)
|
||||
|
||||
# Only ONE worker should be scheduled despite 5 concurrent attempts
|
||||
expect(ConversationReplyEmailWorker.jobs.size).to eq(1)
|
||||
jobs_for_conversation = ConversationReplyEmailWorker.jobs.select { |job| job['args'].first == conversation.id }
|
||||
expect(jobs_for_conversation.size).to eq(1)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user