• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kobotoolbox / kpi / 23752379599 / 5
82%
master: 76%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 30 Mar 2026 03:24PM UTC
Files 904
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

30 Mar 2026 03:17PM UTC coverage: 60.441% (+6.1%) from 54.386%
23752379599.5

push

github

web-flow
fix(qual): fix flaky QA throttling tests in parallel CI using `LocMemCache` isolation (#6881)

### 📣 Summary
This PR resolves intermittent test failures in
`TestAutomaticQAThrottling` by isolating its cache to local memory. This
prevents a race condition where parallel workers with identical
test-database User IDs were colliding in the shared Redis cache.

### 📖 Description
Fixes the intermittent `200 != 429` and `429 != 200` assertion errors in
`TestAutomaticQAThrottling` during parallel GitHub Action runs.

**The Root Cause (Database ID Collision):**
The issue happens when tests run in parallel with multiple workers. DRF
throttling stores request history in the Django cache using a key
derived from the authenticated user's ID (e.g.
`throttle_<scope>_<user.pk>`).

When tests run with multiple workers, each worker creates its own test
database but they share the same cache backend. Since users in each
worker often have the same primary key (e.g. pk=1), they generate the
same throttle cache key.

As a result, requests from different workers collide in the same cache
entry, causing the throttle state to leak across tests. This leads to
nondeterministic failures where tests may receive 200 instead of 429 or
vice versa.

**The Fix:**
Applied the `@override_settings` decorator to the
`TestAutomaticQAThrottling` class to force it to use
`django.core.cache.backends.locmem.LocMemCache`.

This isolates the cache entirely to the local memory of the specific
worker process. Each worker now has its own private "cache bucket,"
preventing cross-worker interference and resolving the flakiness without
requiring us to patch application logic or hardcode unique cache keys.

4654 of 11855 branches covered (39.26%)

21670 of 35853 relevant lines covered (60.44%)

0.6 hits per line

Source Files on job 23752379599.5
  • Tree
  • List 904
  • Changed 197
  • Source Changed 0
  • Coverage Changed 197
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 23752379599
  • 5a5b5cc2 on github
  • Prev Job for on release/2.026.12 (#23690660597.2)
  • Next Job for on release/2.026.12 (#23860065850.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc