Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist automatic entity merges #29568

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

biazmoreira
Copy link
Contributor

@biazmoreira biazmoreira commented Feb 12, 2025

Description

This PR adds persistence to automatic merges of entities. Before, this was only happening in cache and could cause non-deterministic behavior, whereas multiple nodes had a different view of cache.

TODO only if you're a HashiCorp employee

  • Backport Labels: If this fix needs to be backported, use the appropriate backport/ label that matches the desired release branch. Note that in the CE repo, the latest release branch will look like backport/x.x.x, but older release branches will be backport/ent/x.x.x+ent.
    • LTS: If this fixes a critical security vulnerability or severity 1 bug, it will also need to be backported to the current LTS versions of Vault. To ensure this, use all available enterprise labels.
  • ENT Breakage: If this PR either 1) removes a public function OR 2) changes the signature
    of a public function, even if that change is in a CE file, double check that
    applying the patch for this PR to the ENT repo and running tests doesn't
    break any tests. Sometimes ENT only tests rely on public functions in CE
    files.
  • Jira: If this change has an associated Jira, it's referenced either
    in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.
  • ENT PR: If this change has an associated ENT PR, please link it in the
    description. Also, make sure the changelog is in this PR, not in your ENT PR.

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Feb 12, 2025
@biazmoreira biazmoreira force-pushed the biazmoreira/invalidate-merge branch 4 times, most recently from 22f00d2 to 4f904f8 Compare February 13, 2025 17:34
@biazmoreira biazmoreira force-pushed the biazmoreira/invalidate-merge branch 2 times, most recently from bc4fb3f to 53b7098 Compare February 19, 2025 11:47
@hashicorp hashicorp deleted a comment from github-actions bot Feb 19, 2025
Copy link

github-actions bot commented Feb 19, 2025

CI Results:
All Go tests succeeded! ✅

@biazmoreira biazmoreira requested a review from banks February 19, 2025 13:04
@biazmoreira biazmoreira marked this pull request as ready for review February 19, 2025 13:07
@biazmoreira biazmoreira requested review from a team as code owners February 19, 2025 13:07
@biazmoreira biazmoreira requested a review from mpalmi February 19, 2025 13:11
Copy link

github-actions bot commented Feb 19, 2025

Build Results:
All builds succeeded! ✅

@biazmoreira biazmoreira force-pushed the biazmoreira/invalidate-merge branch from 53b7098 to 6e4a30c Compare February 19, 2025 13:51
Comment on lines +1451 to +1461
repeats := 50

for name, flags := range tests {
t.Run(t.Name()+"-"+name, func(t *testing.T) {
// Create a random source specific to this test case so every test case
// starts out from the identical random state given the same seed. We do
// want each iteration to explore different path though so we do it here
// not inside the test func.
seed := rand.New(rand.NewSource(seedval)) // Seed for deterministic test
flags.seed = seed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think we should keep this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind removing it, but it has helped us find problems earlier by running different seeds as part of the same test.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries either way -- I don't insist! In my mind we could accomplish the same thing by using untilfail, but it may also be useful to have multiple test runs.

My only concerns are:

  1. Test bloat on this runner.
  2. Potential for no net-gain having this in CI, since we retry failures to weed out flakes, and that might mask a failing seed.

@biazmoreira biazmoreira force-pushed the biazmoreira/invalidate-merge branch 2 times, most recently from e033f74 to 9af56aa Compare February 19, 2025 14:43
@biazmoreira biazmoreira force-pushed the biazmoreira/invalidate-merge branch from 9af56aa to e180ae7 Compare February 20, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog pr/no-milestone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants