Fix testing of auto checkpointing #4592
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the shortcoming of this idiom in
tests/optioned-server/auto-checkpoints.py:where the second line is executed after auto-checkpointing has started and therefore the directory has been created, and before auto-checkpointing is completed.
In such a case, removing the directory causes auto-checkpointing to fail. This goes unnoticed because the client has no way to know about it, however it throws off the carefully-carved sequence of events that the test code is intended to cause / observe, and testing fails.
How to detect when the server has finished creating a checkpoint, which we need before proceeding with next steps in testing? I added:
ak.client.wait_for_async_activity()that makes the server wait for an in-progress auto-checkpointing, if any, to complete.
An alternative is for the server to create a marker file in the checkpoint directory upon the completion of a checkpoint. I did not implement this, however we may still want to add this. Another way is to "tail"
arkouda.logto see if it ends with a line containing "finished autoCheckpoint".Incidental changes:
currentTime()as a proposed replacement forTime.timeSinceEpoch().totalSeconds().ruokandwait_for_async_activity.