Commit graph

20 commits

Author SHA1 Message Date
ryan-crabbe-berri
e9d40a8f73 test: enforce F811 so a duplicate definition cannot silently replace the first
A name bound twice keeps only the second binding. In `tests/` that is nearly
always a repeated import, harmless but misleading, and the same rule is what
catches the cases that are not harmless: a local that shadows an import the
module still calls, and a second `def test_x` that quietly replaces the first.

311 of the 344 sites were repeated imports and came out with ruff's own fix.
The remaining 33 needed a decision. Four modules imported a name they never
used because a local definition below already shadowed it. Two comprehensions
bound `call` over `unittest.mock.call`, which those modules import and use.
One test rebound the two module handles its nested reload closure had captured.
One class attribute shadowed an unused `status` import.

The load-test fixtures move to a conftest, which is how pytest is meant to share
them, so the test module no longer imports three fixture names it never calls.
The nine `prisma_client` parameters keep a narrow `noqa`: pytest resolves that
fixture by name before the body runs, so the parameter never shadows anything.
2026-08-21 12:06:19 -07:00
yuneng-jiang
a7f3dbcbe3
test(callbacks): harden flaky proxy callback-leak detector (#28195)
* test(callbacks): TEMP diagnostic probe for callback-leak flake

Hardened leak detector (sample N, flag sustained monotonic per-type
growth, normalize instance addresses) + a temporary always-fail probe
on test_check_num_callbacks_on_lowest_latency that dumps the per-type
series and raw reprs via the JUnit failure message, to settle real-leak
vs bounded-pollution on CCI. Diagnostic block is clearly marked and
will be reverted before the PR.

* test(callbacks): harden proxy callback-leak detector, drop diagnostic

CCI diagnostic confirmed the 85->95 jump is a bounded one-time
registration from the test's own switch to latency-based-routing
(+LowestLatencyLoggingHandler, +SlackAlerting), flat at 95 for 2.5 min
under load — not a leak. Final detector: settle past the deliberate
config/update, sample N times, flag only sustained monotonic per-type
growth, normalize instance addresses, name the leaking type on failure.
Removes the temporary always-fail probe.

* test(callbacks): address review - drop redundant settle, close terminal-burst blind spot

- test_check_num_callbacks: remove leftover sleep(30) before sleep(SETTLE_SECONDS) (60s -> 30s dead wait).
- Add _terminal_suspects + _detect_leaks_confirmed: when monotonic net growth is confined to the final interval (escapes the >=2-interval guard), take one confirmation sample. A real ongoing leak keeps climbing and is flagged; a one-time terminal registration plateaus and is ignored.
2026-05-18 16:39:02 -07:00
Ishaan Jaffer
e8461b5b97
style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
Alexsander Hamir
5534038e93
Fix CI: Revert security scan changes and add GitGuardian ignore rules (#18358) 2025-12-22 17:03:53 -08:00
Ishaan Jaffer
6112160a16 Revert "[Fix] Security - Remove example API keys with high entropy (#18255)"
This reverts commit 24edbccf5c.
2025-12-20 20:48:11 +05:30
Alexsander Hamir
24edbccf5c
[Fix] Security - Remove example API keys with high entropy (#18255) 2025-12-19 10:09:50 -08:00
Alexsander Hamir
eaa04cd8ce
fix: use fastuuid helper (#14903)
* fix: use fastuuid helper across the codebase

First batch of changes, simple drop in replacement.

* second batch of changes

* fixed: script mistake on helper file
2025-09-25 15:47:01 -07:00
Ishaan Jaff
7af7610929 fix - test num callbacks 2024-05-17 22:06:51 -07:00
Ishaan Jaff
d94065ca43 fix - num active callbacks 2024-05-06 18:20:27 -07:00
Ishaan Jaff
15b264bd4e fix num callbacks test 2024-05-06 18:13:15 -07:00
Ishaan Jaff
5368382c03 fix num callbacks test 2024-05-06 18:12:45 -07:00
Ishaan Jaff
562ef2d2e1 fix - add better debugging on num_callbacks test 2024-05-06 13:42:20 -07:00
Ishaan Jaff
4f8ee64e8a ci/cd run again 2024-05-06 11:32:14 -07:00
Ishaan Jaff
2084cfd959 fix - test_check_num_callbacks 2024-05-03 16:41:08 -07:00
Ishaan Jaff
a369867e02 test - num alerts on callbacks 2024-05-03 14:46:44 -07:00
Ishaan Jaff
e5311d35f2 fix test len active callbacks 2024-05-03 14:32:13 -07:00
Ishaan Jaff
e9eead2f25 test - size of callbacks, alerts 2024-05-03 14:22:15 -07:00
Ishaan Jaff
9ba5685722 test active callbacks on proxy 2024-05-03 10:05:06 -07:00
Ishaan Jaff
fe6e465466 test - num callbacks on proxy should not increase 2024-05-03 09:59:59 -07:00
Ishaan Jaff
a1814a3e4c test - num callbacks on proxy 2024-05-03 09:13:37 -07:00