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

apps: Fix crash with nonexisting /etc/os-release #19416

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions test/verify/check-apps
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ class TestApps(packagelib.PackageCase):
b.wait_not_present("#refresh-progress")
b.wait_visible(".pf-v5-c-empty-state")

# known OS: appstream-data-tst gets installed from the map
# known OS: appstream-data-test gets installed from the map
m.write("/etc/os-release", 'ID="derivative"\nID_LIKE="spicy testy"\nVERSION_ID="1"\n')
b.click("#refresh")
with b.wait_timeout(30):
b.wait_visible(".app-list #app-1")
m.execute("until test -e /usr/share/app-info/xmls/test.xml; do sleep 1; done")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about using b.wait for the loop? Then we can control the timeout in the usual way and don't need to wait for the global timeout when this fails.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m.execute() has a default timeout of 2 minutes; it can be changed with timeout=, but the default seemed quite appropriate to me. We often use this pattern in our tests, see git grep -E 'execute.*(while|until)'

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and wait() (not b.wait() !) is more expensive, as it creates new SSH connections for each iteration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m.execute() has a default timeout of 2 minutes

Ah, I didn't think of that!

b.wait_visible(".app-list #app-1")

def testL10N(self):
b = self.browser
Expand Down