Skip to content

fix(provider): read sectors from the backend; clearer combobox and rate-limit failures - #128

Merged
saqibmanan merged 9 commits into
CIfrom
fix/provider-sectors-from-backend-CI
Sep 25, 2026
Merged

saqibmanan merged 9 commits into
CIfrom
fix/provider-sectors-from-backend-CI

Conversation

@saqibmanan

Copy link
Copy Markdown
Contributor

Fixes the provider-smoke failures that have been red on every recent CI push and PR (for example #122 and #124: prv_006, 006b, 007, 011 and 012).

Root cause: stale test data, not load

The 2026-09-24 dev refresh from prod replaced the sector list. "Budgets" no longer exists on dev, whose 8 sectors are now Child Rights, Public Finance, Law And Justice, and so on. Eleven provider tests hardcoded it. The combobox never offered the option, so each test died with a blank TimeoutException on every rerun, which looked exactly like the old contention failures.

I checked the other hardcoded taxonomy values against dev (India/Assam, SDG 13, the Budget/Finance tags). All of them still exist.

Changes

  • sector_name fixture (session scope): reads { sectors { name } } live from API_BASE_URL, the same pattern as backend_enum_labels. All 11 tests use it, and the stale SECTORS constants and aliases are removed from tests/data.
  • Combobox timeouts name the problem. A new BasePage.wait_for_option() is used by select_combobox_option and the AI model picker. On timeout it raises No option 'X' after Ns. Options listed: [...], scoped to that input's own listbox so the Bhashini language options don't show up.
  • go_to_metadata_tab uses click_until. After "Dataset created successfully" the form can re-render into "Loading" once more. test_prv_002 hit ElementClickIntercepted on the tab because of this.
  • Failure hook flags a backend 429. At 1000 POST/hour per IP, a few suite runs are enough to throttle the backend, and the next failures then look like blank timeouts on the dashboard. The report now gets a "backend rate limit" section when the API answers 429 at failure time.

Evidence (headless, -n 3, against dev)

Run Result
CI before the fix, -m smoke 5 failed, 7 passed, 10 rerun, 21 min
Sector fix, -m smoke 12 passed, 0 rerun, 8 min
Final branch, -m "smoke or functional" 17 passed, 1 xfailed, 1 xpassed, 0 rerun, 15 min

The new timeout message was checked by forcing the fixture to "Budgets": No option 'Budgets' after 30s. Options listed (filtered by the typed text): [...], on both the BasePage and AI model paths. The 429 section was checked while the backend was actually throttled.

Not changed, worth a look

  • test_prv_008_org_add_charts XPASSes and test_prv_004_ind_add_charts still XFAILs. Both carry xfail("Charts feature isn't fully built yet"). Either charts now work for orgs and 004 has a real test bug, or 008 passes by accident. One XPASS isn't enough to drop the marker, and strict=False keeps it harmless.

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