Skip to content

Conversation

weyfonk
Copy link
Contributor

@weyfonk weyfonk commented Sep 17, 2024

This commit is meant to test a hypothesis about flakiness of drift correction tests coming from a race condition between:

  • the Fleet agent's Helm release cleanup mechanism, which deletes releases for which no bundle exists, at a configurable frequency (previously set to 1s for testing purposes)
  • deletion of bundle deployments, re-created by Fleet controllers when a GitRepo is updated.

Release cleanup end-to-end tests, which depend on a short garbage collection interval, are skipped to prevent noise caused by unrelated test failures.

Refers to #2858
Refers to #2771.

@weyfonk weyfonk requested a review from a team as a code owner September 17, 2024 11:02
@weyfonk weyfonk marked this pull request as draft September 17, 2024 11:03
@weyfonk weyfonk force-pushed the fix-drift-e2e-tests branch from 1fae0d0 to 1882b6e Compare September 18, 2024 05:44
@weyfonk weyfonk changed the title [TEST] Deploy Fleet with longer garbage collection interval Convert drift e2e tests into integration tests Sep 18, 2024
@weyfonk weyfonk force-pushed the fix-drift-e2e-tests branch 2 times, most recently from 411d828 to 8f693ef Compare September 19, 2024 08:42
This commit is meant to test a hypothesis about flakiness of drift
correction tests coming from a race condition between:
* the Fleet agent's Helm release cleanup mechanism, which deletes
  releases for which no bundle exists, at a configurable frequency
  (previously set to 1s for testing purposes)
* deletion of bundle deployments, re-created by Fleet controllers when a
  `GitRepo` is updated.

Release cleanup end-to-end tests, which depend on a short garbage
collection interval, are skipped to prevent noise caused by unrelated
test failures.
Would the first call to garbage collection be enough to cause a race
condition?
That bundle reconciler method creates bundle deployments, not bundles.
This migrates an end-to-end test case for disabled drift correction to
integration tests, as the first step of a larger effort to migrate as
many of them as possible.
This removes checks on bundle statuses, which are unrelated to drift
correction and already covered in status tests
(`integrationtests/agent/bundle_deployment_status_test.go`
This paves the way for migrating more drift correction tests away from
end-to-end tests.
This migrates another drift correction test from end-to-end to
integration.
Editing a config map with drift correction enabled but not forced is now
covered by integration tests instead of end-to-end tests.
Editing a service port with drift correction enabled and forced is now
covered by integration tests instead of end-to-end tests.
Deploying a resource with a status with drift correction enabled is now
covered by integration tests instead of end-to-end tests.
Editing a deployment with drift correction enabled but not forced is now
covered by integration tests instead of end-to-end tests.
Updating a bundle deployment to force its drift correction mode, and fix
drift correction failures, is now covered by integration tests instead
of end-to-end tests.
All existing drift correction cases are now covered in integration
tests.
This fixes a failing test case where rollbacks would not be forced
because the bundle deployment's `CorrectDrift` mode was set to `true` in
its options, where it should have been done directly in its spec.
That end-to-end test case was flaky, and could easily be migrated to
integration tests.
@weyfonk weyfonk force-pushed the fix-drift-e2e-tests branch from df64742 to a0e92bf Compare September 19, 2024 12:56
@weyfonk weyfonk marked this pull request as ready for review September 19, 2024 14:17
Copy link
Member

@manno manno left a comment

Choose a reason for hiding this comment

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

Please squash :)

@weyfonk weyfonk merged commit 70b5adf into rancher:main Sep 20, 2024
12 checks passed
weyfonk added a commit to weyfonk/fleet that referenced this pull request Sep 27, 2024
* Simplify drift correction integration tests

This removes checks on bundle statuses, which are unrelated to drift
correction and already covered in status tests
(`integrationtests/agent/bundle_deployment_status_test.go`).

* Migrate drift correction end-to-end tests

This migrates end-to-end test cases for drift correction to
integration tests, simplifying them and reducing the risk of flakiness.

* Rename `createBundle` as `createBundleDeployment`

That bundle reconciler method creates bundle deployments, not bundles.

* Convert bundle deletion e2e test into integration test

That end-to-end test case was flaky, and could easily be migrated to
integration tests.
thardeck pushed a commit that referenced this pull request Oct 1, 2024
* Convert drift e2e tests into integration tests (#2861)

* Simplify drift correction integration tests

This removes checks on bundle statuses, which are unrelated to drift
correction and already covered in status tests
(`integrationtests/agent/bundle_deployment_status_test.go`).

* Migrate drift correction end-to-end tests

This migrates end-to-end test cases for drift correction to
integration tests, simplifying them and reducing the risk of flakiness.

* Rename `createBundle` as `createBundleDeployment`

That bundle reconciler method creates bundle deployments, not bundles.

* Convert bundle deletion e2e test into integration test

That end-to-end test case was flaky, and could easily be migrated to
integration tests.

* Skip `e2e/drift` in CI workflows

That path no longer exists, therefore `ginkgo` must no longer be called
with it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants