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

Fix context usage in E2E #1602

Open
ramizpolic opened this issue Apr 25, 2024 · 0 comments
Open

Fix context usage in E2E #1602

ramizpolic opened this issue Apr 25, 2024 · 0 comments

Comments

@ramizpolic
Copy link
Member

          Okay so, we have a problem with passing contexts to these functions from the parent.

The issue why we can't use the ctx variable here from the afterSetup function's parameter is because if you follow up the call chain then that ctx is the setupCtx variable in the beforeSuit function, see here: https://github.com/openclarity/vmclarity/blob/main/e2e/suite_test.go#L68

That context ends when the beforeSuit function runs to completion and after that the context is not available, but with the current solution we want to use that context in actual tests (because we want to have an open SSH connection to VMClarity control plane while the tests are running).

This is not going to work, we have to rework how we pass context from ginkgo's test suite creation to the actual test environments, but I think that's out of the scope of this PR.

The situation is the same here in your previous comment - https://github.com/openclarity/vmclarity/pull/1601/files/de050880ac466a03a92bbf25a6497d4bde060beb#diff-7be911ff144b8813d4374c3f85695689dd505e9ace576d90e7f0f2b7a071b421R327 - the context that we pass to the iamService is cancelled when the beforeSuit ends, but we want to use this context in the TearDown where we want to undelete the 2 roles.

Originally posted by @adamtagscherer in #1601 (comment)

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

No branches or pull requests

1 participant