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

Enable garbage collection by default in system tests #3706

Open
patchwork01 opened this issue Nov 15, 2024 · 0 comments
Open

Enable garbage collection by default in system tests #3706

patchwork01 opened this issue Nov 15, 2024 · 0 comments

Comments

@patchwork01
Copy link
Collaborator

patchwork01 commented Nov 15, 2024

Background

Split from:

A system test instance is currently paused by default, so the scheduled rules never invoke garbage collection. We invoke it explicitly, but this happens for the whole instance.

Description

Instead of explicitly invoking garbage collection in system tests, we'd like to enable it by default. When we wait for garbage collection in tests, we can wait for the scheduled rule to run.

This should be more representative of how the system works in reality, and it should make the tests easier to parallelise.

Analysis

We can ensure that the schedule rule for garbage collection is enabled when we connect to an instance in DeployedSleeperInstances.createInstanceIfMissing. We can avoid ever pausing the schedule rule for GC in any tests.

There is currently code for working with schedule rules in SnapshotsDriver. We could move that to a separate driver for schedule rules. Note that the code to disable the snapshot rule there is not currently used, so it could be deleted.

Note that all instances are deployed paused in AwsSleeperInstanceDriver.deployInstanceIfNotPresent.

We can remove SystemTestGarbageCollection.invoke, GarbageCollectionDriver and all driver implementations. We may need to adjust the amount of time that tests wait for GC to be applied. We'll need to increase the frequency of GC (sleeper.gc.period.minutes) and lower the delay before deletion (sleeper.default.gc.delay.minutes), both defined in GarbageCollectionProperty. We can set those in SystemTestInstance.createInstanceProperties.

If we still need to invoke garbage collection explicitly in any tests, we can do it just for the tables in that test. We'd like to avoid this if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant