consul/test/integration/consul-container
Matt Keeler a7774a9538
Introduce randomized timings and reproducible randomization into controller integration tests. (#19393)
As the V2 architecture hinges on eventual consistency and controllers reconciling the existing state in response to writes, there are potential issues we could run into regarding ordering and timing of operations. We want to be able to guarantee that given a set of resources the system will always eventually get to the desired correct state. The order of resource writes and delays in performing those writes should not alter the final outcome of reaching the desired state.

To that end, this commit introduces arbitrary randomized delays before performing resources writes into the `resourcetest.Client`. Its `PublishResources` method was already randomizing the order of resource writes. By default, no delay is added to normal writes and deletes but tests can opt-in via either passing hard coded options when creating the `resourcetest.Client` or using the `resourcetest.ConfigureTestCLIFlags` function to allow processing of CLI parameters.

In addition to allowing configurability of the request delay min and max, the client also has a configurable random number generator seed. When Using the CLI parameter helpers, a test log will be written noting the currently used settings. If the test fails then you can reproduce the same delays and order randomizations by providing the seed during the previous test failure.
2023-11-08 10:45:25 -05:00
..
assets Add traffic permissions integration tests. (#19008) 2023-10-06 12:06:12 -04:00
libs chore: apply enterprise changes that were missed to some testing files (#19504) 2023-11-03 11:43:43 -05:00
test Introduce randomized timings and reproducible randomization into controller integration tests. (#19393) 2023-11-08 10:45:25 -05:00
go.mod build: dependency updates for 1.17.0 (#19453) 2023-11-03 12:29:59 -04:00
go.sum resource: finalizer aware delete endpoint (2 of 5) (#19493) 2023-11-03 10:10:58 -04:00