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

[6.12.z] browser teardown fix at session exit #1396

Conversation

Satellite-QE
Copy link
Contributor

Cherrypick of PR: #1390

Problem Statement

When nesting airgun.session.Session in multiple context managers (like robottelo session fixture does),
the __exit__ method, which handles browser teardown, is called mutliple times as well.

This causes that the second and further attempt to call webdriver.quit() will fail,
because the browser was already closed.

Solution

Execute the browser teardown only once.

Related Issues

Needed for SatelliteQE/robottelo#15050

The browser teardown in `airgun.session.Session.__exit__` should be executed only once.

Because when `Session` is nested in multiple context managers(*),
the `__exit__` method is called for each one
and this causes that the second and further `webdriver.quit()` call will fail,
because the browser session was already stopped.

(*) for example in the robottelo `session` fixture in `robottelo/pytest_fixtures/core/ui.py`.

(cherry picked from commit d9cfc90)
@Satellite-QE Satellite-QE added 6.12.z Auto_Cherry_Picked GHA has automatically cherrypicked this PR No-CherryPick PR doesnt need CherryPick to previous branches labels May 23, 2024
@Satellite-QE Satellite-QE added the AutoMerge_Cherry_Picked Automatically merge the PR is PRT and all checks are passing label May 23, 2024
@Satellite-QE Satellite-QE merged commit 4886124 into 6.12.z May 23, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.12.z Auto_Cherry_Picked GHA has automatically cherrypicked this PR AutoMerge_Cherry_Picked Automatically merge the PR is PRT and all checks are passing No-CherryPick PR doesnt need CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants