consul/internal/resource
hc-github-team-consul-core da2a57239e
Backport of Introduce randomized timings and reproducible randomization into controller integration tests. into release/1.17.x (#19575)
Introduce randomized timings and reproducible randomization into controller integration tests.

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.

# Conflicts:
#	internal/catalog/catalogtest/run_test.go
#	internal/catalog/catalogtest/test_integration_v2beta1.go
#	test/integration/consul-container/test/catalog/catalog_test.go

Co-authored-by: Matt Keeler <mjkeeler7@gmail.com>
2023-11-08 16:39:28 -05:00
..
demo Backport of catalog, mesh: implement missing ACL hooks into release/1.17.x (#19212) 2023-10-14 01:50:22 +00:00
http v2tenancy: cluster scoped reads (#19082) 2023-10-10 13:30:23 -05:00
mappers mesh: Add ComputedProxyConfiguration and a controller that computes it. (#19043) 2023-10-10 17:34:53 -06:00
protoc-gen-deepcopy Backport of Clone proto into deepcopy correctly into release/1.17.x (#19207) 2023-10-13 22:07:49 +00: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
reaper
resourcetest Backport of Introduce randomized timings and reproducible randomization into controller integration tests. into release/1.17.x (#19575) 2023-11-08 16:39:28 -05:00
testdata
acls.go Backport of catalog, mesh: implement missing ACL hooks into release/1.17.x (#19212) 2023-10-14 01:50:22 +00:00
authz.go
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
decode_test.go
equality.go
equality_test.go
errors.go Backport of catalog, mesh: implement missing ACL hooks into release/1.17.x (#19212) 2023-10-14 01:50:22 +00:00
errors_test.go
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
reference.go
refkey.go
refkey_test.go
registry.go Backport of catalog, mesh: implement missing ACL hooks into release/1.17.x (#19212) 2023-10-14 01:50:22 +00:00
registry_test.go
sort.go
sort_test.go
stringer.go
tenancy.go mesh: ensure that xRoutes have ParentRefs that have matching Tenancy to the enclosing resource (#19176) 2023-10-13 11:31:56 -05:00
tenancy_bridge_ce.go Remove old build tags (#19128) 2023-10-10 10:58:06 -04:00
tenancy_test.go
tombstone.go