consul/internal/resource
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
..
demo resource: enforce lowercase v2 resource names (#19218) 2023-10-16 12:55:30 -05:00
http Tenancy Bridge v2 (#19220) 2023-10-20 14:49:54 -04:00
mappers mesh: Add ComputedProxyConfiguration and a controller that computes it. (#19043) 2023-10-10 17:34:53 -06:00
protoc-gen-deepcopy Clone proto into deepcopy correctly (#19204) 2023-10-13 16:41:22 -04:00
protoc-gen-json-shim Create DeepCopy() and Json Marshal/Unmarshal for proto-public (#19015) 2023-10-13 14:55:58 +00:00
protoc-gen-resource-types Add protoc generator to emit resource type variables (#18957) 2023-09-21 17:18:47 -04:00
reaper [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
resourcetest Introduce randomized timings and reproducible randomization into controller integration tests. (#19393) 2023-11-08 10:45:25 -05:00
testdata Add type validations for the catalog resources (#17211) 2023-05-12 09:24:55 -04:00
acls.go catalog, mesh: implement missing ACL hooks (#19143) 2023-10-13 23:16:26 +00:00
authz.go resource: ensure resource.AuthorizerContext properly strips the local… (#18908) 2023-09-19 17:14:15 -05:00
authz_ce.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
authz_ce_test.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
decode.go Resource Hook Pre-Decode Utilities (#18548) 2023-10-26 16:39:06 -04:00
decode_test.go resource: Require scope for resource registration (#18635) 2023-09-01 09:44:53 -05:00
equality.go bimapper: allow to untrack links and support reference or id (#18451) 2023-08-17 18:03:05 -06:00
equality_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
errors.go catalog, mesh: implement missing ACL hooks (#19143) 2023-10-13 23:16:26 +00:00
errors_test.go catalog,mesh,auth: Bump versions to v2beta1 (#18930) 2023-09-22 10:51:15 -06:00
filter.go catalog: add metadata filtering to refine workload selectors (#19198) 2023-10-13 13:37:42 -05:00
filter_test.go catalog: add metadata filtering to refine workload selectors (#19198) 2023-10-13 13:37:42 -05:00
hooks.go Resource Hook Pre-Decode Utilities (#18548) 2023-10-26 16:39:06 -04:00
hooks_test.go Resource Hook Pre-Decode Utilities (#18548) 2023-10-26 16:39:06 -04:00
reference.go mesh: Wire ComputedRoutes into the ProxyStateTemplate via the sidecar controller (#18752) 2023-09-14 17:19:04 -05:00
refkey.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
refkey_test.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
registry.go Resource Hook Pre-Decode Utilities (#18548) 2023-10-26 16:39:06 -04:00
registry_test.go resource: allow for the ACLs.Read hook to request the entire data payload to perform the authz check (#18925) 2023-09-22 09:53:55 -05:00
resource.go resource: misc finalizer apis (#19474) 2023-11-02 15:56:02 -05:00
resource_test.go resource: misc finalizer apis (#19474) 2023-11-02 15:56:02 -05:00
sort.go mesh: store bound reference pointers on a ComputedRoutes resource and use during reconcile (#18965) 2023-09-22 15:46:14 -05:00
sort_test.go mesh: store bound reference pointers on a ComputedRoutes resource and use during reconcile (#18965) 2023-09-22 15:46:14 -05:00
stringer.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00
tenancy.go Tenancy Bridge v2 (#19220) 2023-10-20 14:49:54 -04:00
tenancy_test.go resource: add helper to normalize inner Reference tenancy during mutate (#18765) 2023-09-13 12:08:12 -05:00
tombstone.go [COMPLIANCE] License changes (#18443) 2023-08-11 09:12:13 -04:00