-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
Add a coverage test for pantsd garbage collection, and fix type error #9271
Add a coverage test for pantsd garbage collection, and fix type error #9271
Conversation
cb61011
to
abc3d5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this!
# Ensure that the thread runs successfully for long enough to have run each step at least once. | ||
# TODO: This is a coverage test: although it could examine the internal details of the service | ||
# to validate correctness, we don't do that yet. | ||
time.sleep(interval_secs * 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tried running this multiple times to test for flakiness? Note that you'd need to use the V1 test runner because of V2's caching.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not, but I believe that the deltas here are sufficient to avoid flakes. If not, they should be very easy to tune.
…erSession, but getting a Scheduler.
abc3d5a
to
28fb234
Compare
#9271) ### Problem `StoreGCService` was expecting a `SchedulerSession`, but getting a `Scheduler`. This meant that if `pantsd` ran long enough (the default value for "long enough" was too long to ever be caught in tests), it would crash with a failure to call `lease_files_in_graph` due to the method signature change in #9015. ### Solution Although just adding enough type hints here would hypothetically be enough for mypy to catch this (?), additionally added a coverage test for `StoreGCService`. ### Result `pantsd` stays up as long as it should.
#9271) ### Problem `StoreGCService` was expecting a `SchedulerSession`, but getting a `Scheduler`. This meant that if `pantsd` ran long enough (the default value for "long enough" was too long to ever be caught in tests), it would crash with a failure to call `lease_files_in_graph` due to the method signature change in #9015. ### Solution Although just adding enough type hints here would hypothetically be enough for mypy to catch this (?), additionally added a coverage test for `StoreGCService`. ### Result `pantsd` stays up as long as it should.
Problem
StoreGCService
was expecting aSchedulerSession
, but getting aScheduler
. This meant that ifpantsd
ran long enough (the default value for "long enough" was too long to ever be caught in tests), it would crash with a failure to calllease_files_in_graph
due to the method signature change in #9015.Solution
Although just adding enough type hints here would hypothetically be enough for mypy to catch this (?), additionally added a coverage test for
StoreGCService
.Result
pantsd
stays up as long as it should.