c2bd829fe2
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.
8 lines
332 B
Go
8 lines
332 B
Go
package structs
|
|
|
|
// MaxUUIDsPerWriteRequest is the maximum number of UUIDs that can be included
|
|
// within a single write request. This is to ensure that the Raft message does
|
|
// not become too large. The resulting value corresponds to 0.25MB of IDs or
|
|
// 7281 UUID strings.
|
|
const MaxUUIDsPerWriteRequest = 7281 // (1024 * 256) / 36
|