Skip to content

test: Ignore background jobs in recents counts - #5300

Merged
taratatach merged 2 commits into
masterfrom
fix/flaky-recents-request-count
Nov 18, 2026
Merged

taratatach merged 2 commits into
masterfrom
fix/flaky-recents-request-count

Conversation

@taratatach

@taratatach taratatach commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

TestRecentsListCompletesTheDriveItems failed once on #5251 (expected
11 CouchDB requests, got 12):
https://github.com/linagora/cozy-stack/actions/runs/43977901272/job/133686519208

The counter wrapped the shared CouchDB client, so it also counted the
requests of the jobs run in the background by the triggers on the
files: the thumbnail jobs of the test images, which have no content
and fail then retry, and the instance lookups of the antivirus
trigger. The counters of the recents tests now keep only the requests
to the databases of the instances under test, without the jobs
database.

A thumbnail job also reads the parent folder of its image to open it,
in the databases of the owner. The count of the drives test now starts
once the owner has no thumbnail job queued or running.

  The recents tests compare the number of CouchDB requests of two calls
  to `GET /files/recents`. The counter wrapped the shared CouchDB client,
  so it also counted the requests of the jobs run in the background by
  the triggers on the files: the thumbnail jobs of the images without
  content, which fail and retry, and the instance lookups of the
  antivirus trigger. One of them landing during a call made the test
  fail once in a while.

  The counters now keep only the requests to the databases of the
  instances under test, without the jobs database.

Co-Authored-By: AI
@taratatach taratatach self-assigned this Nov 17, 2026
  The drives test of the recents still failed once in a while: the count
  of a call to `GET /files/recents` got one more request on the databases
  of the owner. The thumbnail jobs of the images of the owner read the
  parent folder of their file to open it, and they fail then retry while
  the test runs, because the images have no content.

  The count now starts once the owner has no thumbnail job queued or
  running.

Co-Authored-By: AI
@taratatach
taratatach marked this pull request as ready for review November 18, 2026 09:14
@taratatach
taratatach requested a review from shepilov as a code owner November 18, 2026 09:14
@taratatach
taratatach merged commit ede9a36 into master Nov 18, 2026
6 checks passed
@taratatach
taratatach deleted the fix/flaky-recents-request-count branch November 18, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant