-
Notifications
You must be signed in to change notification settings - Fork 46
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
E2E tests (run in CI) are not cleaning up server and project artifacts #343
Labels
bug
Something isn't working
Comments
Here is how that is done in TF: |
Additionally:
|
/assign @aayushrangwala |
E2E test runs are still leaving resources behind, even after #405 was merged (and it should be noted that they're also taking far longer to complete). |
displague
added a commit
that referenced
this issue
Dec 20, 2023
A recent refactor of the test code introduced persistent timeouts, even in tests that do not perform API-intensive tasks (for example, read-only tests that request capacity information). These timeouts were happening because the tests temporarily replace stdout with a byte buffer in order to capture command output for validation; during the most recent refactor, the code that closes the byte buffer and restores stdout was moved to a `t.Cleanup` handler, so the buffer was not closed until after the test finished, causing the test to hang until it timed out. This moves the stdout-juggling code into a helper function to ensure that we are using the same logic across all tests. The helper function logs any errors that happen while closing or reading the byte buffer, but does not fail the test for those errors; the tests themselves should fail if those errors impact the behavior under test. Fixes #416. Related to #343. In addition, existing test helpers are refactored to more easily ensure that resources created with test helpers are automatically cleaned up after a test runs and to ensure that tests fail early if a test resource could not be created. Test helpers for deleting resources now log the ID of the resource they are trying to delete so we can more easily triage issues with test cleanup.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
Servers created through E2E testing are not being deleted after the tests complete.
The project name is the same in each test so it is difficult to say which test triggered the project (and to identify if the devices were orphaned as a result of a failed run).
It is possible that an attempt was made to delete the servers and this failed (on the API side). This would block the deletion of the project.
How can we reproduce it?
Ensure that deletion is always carried out on the servers in the project and the project.
Create test servers with a deletion value so that they are automatically reaped.
CLI version (
metal --version
):The text was updated successfully, but these errors were encountered: