Skip to content

Commit

Permalink
🧹 Fix flaky variant cycle test. (#945)
Browse files Browse the repository at this point in the history
  • Loading branch information
preslavgerchev authored Nov 10, 2023
1 parent f66af37 commit 3ed6c68
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion policy/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ const (
)

var ErrVariantCycleDetected = func(mrn string) error {
return fmt.Errorf("variant cycle in %s detected", mrn)
return fmt.Errorf("variant cycle detected in %s", mrn)
}

func detectVariantCycles(queries map[string]*explorer.Mquery) error {
Expand Down
4 changes: 2 additions & 2 deletions policy/policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ queries:
pInitial := bundleInitial.Policies[0]
pInitial.InvalidateLocalChecksums()
_, err = bundleInitial.Compile(context.Background(), schema, nil)
require.Equal(t, policy.ErrVariantCycleDetected("//local.cnspec.io/run/local-execution/queries/variant1"), err)
require.Contains(t, err.Error(), "variant cycle detected")
}

{
Expand Down Expand Up @@ -401,6 +401,6 @@ queries:
pInitial := bundleInitial.Policies[0]
pInitial.InvalidateLocalChecksums()
_, err = bundleInitial.Compile(context.Background(), schema, nil)
require.Equal(t, policy.ErrVariantCycleDetected("//local.cnspec.io/run/local-execution/queries/variant1"), err)
require.Contains(t, err.Error(), "variant cycle detected")
}
}

0 comments on commit 3ed6c68

Please sign in to comment.