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

Add execution_id for resuming/skipping test independently. #1529

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

copybara-service[bot]
Copy link
Contributor

@copybara-service copybara-service bot commented Jan 23, 2025

Add execution_id for resuming/skipping test independently.

This is done by checking and writing base_workdir/test.execution_id with the execution_id.

Given a test to run, we check whether the coverage dir (inside the workdir) exists and if the .execution_id stamp matches the current execution ID, then resume the progress if:

  • execution ID mismatch: the test was not run in this execution - create the coverage dir, run for the whole duration, and remove the coverage dir once finished.
  • execution ID matches but the coverage dir is missing: the test was done previously for this exeuction - skip running the test.
  • execution ID matches but the coverage dir exists: the test was run previously but interrupted - run for the duration based on the previously recorded running time in the workdir.

One side-effect is that now the base workdir.[shard] directory is not cleaned up upon the completion. Instead, the workdirs inside are removed, but the .execution_id files there kept as tombstones and read by later executions.

@copybara-service copybara-service bot force-pushed the cl/718872113 branch 7 times, most recently from 76b8372 to 0f716f9 Compare January 30, 2025 20:13
@copybara-service copybara-service bot changed the title No public description Add execution_id for resuming/skipping test independently. Jan 30, 2025
This is done by checking and writing base_workdir/test.execution_id with the execution_id.

Given a test to run, we check whether the coverage dir (inside the workdir) exists and if the .execution_id stamp matches the current execution ID, then resume the progress if:

  - execution ID mismatch: the test was not run in this execution - create the coverage dir, run for the whole duration, and remove the coverage dir once finished.
  - execution ID matches but the coverage dir is missing: the test was done previously for this exeuction - skip running the test.
  - execution ID matches but the coverage dir exists: the test was run previously but interrupted - run for the duration based on the previously recorded running time in the workdir.

One side-effect is that now the base `workdir.[shard]` directory is not cleaned up upon the completion. Instead, the workdirs inside are removed, but the .execution_id files there kept as tombstones and read by later executions.

PiperOrigin-RevId: 721566201
@copybara-service copybara-service bot merged commit 44ac6c2 into main Jan 31, 2025
@copybara-service copybara-service bot deleted the cl/718872113 branch January 31, 2025 01:03
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.

1 participant