From c09206c22ea5c1503250149fd952716bb5c3641a Mon Sep 17 00:00:00 2001 From: Aakash Bakhle <48802744+aakashb95@users.noreply.github.com> Date: Wed, 29 Apr 2026 17:36:14 +0530 Subject: [PATCH] fix: flaky time based document sync spec (#14320) fixes: https://app.circleci.com/pipelines/github/chatwoot/chatwoot/111572/workflows/210e3618-301a-4a8f-a411-826214965441/jobs/146263 --- .../documents/schedule_syncs_job_spec.rb | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/spec/enterprise/jobs/captain/documents/schedule_syncs_job_spec.rb b/spec/enterprise/jobs/captain/documents/schedule_syncs_job_spec.rb index 50ef8b2b3..e7a16db5b 100644 --- a/spec/enterprise/jobs/captain/documents/schedule_syncs_job_spec.rb +++ b/spec/enterprise/jobs/captain/documents/schedule_syncs_job_spec.rb @@ -62,17 +62,17 @@ RSpec.describe Captain::Documents::ScheduleSyncsJob, type: :job do end it 'marks the due document as syncing before queueing' do - document = create( - :captain_document, - assistant: assistant, - account: account, - status: :available, - sync_status: :synced, - last_synced_at: 3.days.ago - ) - clear_enqueued_jobs - travel_to Time.zone.local(2026, 4, 27, 10, 0, 0) do + document = create( + :captain_document, + assistant: assistant, + account: account, + status: :available, + sync_status: :synced, + last_synced_at: 3.days.ago + ) + clear_enqueued_jobs + described_class.new.perform expect(document.reload).to have_attributes(