open-nomad/.semgrep
Tim Gross c2bd829fe2
tests: don't mutate global structs in core scheduler tests (#16120)
Some of the core scheduler tests need the maximum batch size for writes to be
smaller than the usual `structs.MaxUUIDsPerWriteRequest`. But they do so by
unsafely modifying the global struct, which creates test flakes in other tests.

Modify the functions under test to take a batch size parameter. Production code
will pass the global while the tests can inject smaller values. Turn the
`structs.MaxUUIDsPerWriteRequest` into a constant, and add a semgrep rule for
avoiding this kind of thing in the future.
2023-02-10 09:26:00 -05:00
..
api_errorf.yml api: use errors.New not fmt.Errorf when error doesn't have format. (#14027) 2022-08-05 17:05:47 +02:00
changelog.yml ci: add semgrep (#11934) 2022-01-26 16:32:47 -05:00
fsm_time.yml semgrep: add MeasureSinceWithLabels to FSM time rule (#14812) 2022-10-06 10:59:53 -04:00
go_tests.yml ci: do not exclude Parallel semgrep rule 2022-03-17 13:45:56 -05:00
http_endpoint.yml api: ensure ACL role upsert decode error returns a 400 status code. (#15253) 2022-11-18 17:47:43 +01:00
loopclosure.yml Data race fixes in tests and a new semgrep rule (#14594) 2022-09-15 10:35:08 -07:00
protect_globals.yml tests: don't mutate global structs in core scheduler tests (#16120) 2023-02-10 09:26:00 -05:00
rpc_endpoint.yml metrics: Add remaining server RPC rate metrics (#15901) 2023-01-27 08:29:53 -05:00
rpc_metrics.yml metrics: Add RPC rate metrics to endpoints that validate TLS names (#15900) 2023-01-26 15:04:25 -05:00
time_after.yml add semgrep rule to check for potential time.After leaks (#12001) 2022-02-03 17:33:07 -05:00
ui.yml ci: add semgrep rule to catch usage of invalid string extensions (#12509) 2022-04-08 10:58:32 -04:00