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 testLifecycleOperationsUser restart test, add debug logging #1327

Merged

Conversation

martinpitt
Copy link
Member

Broken out from PR #1324, as these are ready for landing and already help with debugging. That former PR stress-tests testLifecycleOperationsUser. I still saw a different failure mode of testLifecycleOperationsUser, but the primary one should be fixed now.

Add a debug() API that gets enabled with `window.debugging = "podman"`,
similar to how our other Cockpit projects work.

Log all REST calls and monitor events.
We hvae to wait until the action menu is actually open for this absence
test to be meaningful.
The old "pid changed" waiting loop was completely broken, as the old pid
wasn't stripped (thus ending in `\n`), while the new one was. Thus the
wait condition was immediately true.

Nevertheless, it's not enough to wait for the system state to change, as
the UI gets updated asynchronously. The restart events leaked into the
following "Force stop" check, and caused unexpected UI changes.

There is no steady state change visible in the UI after a restart.
Expose the "Pid" and "StartedAt" properties as additional data
properties, and use them in the test to wait until the UI actually
caught up with the restart.

Also, drop the unnecessary no-op filter change, the filter is already
set to "All".
@martinpitt martinpitt added the flake unstable test label Jul 3, 2023
@martinpitt martinpitt mentioned this pull request Jul 3, 2023
Comment on lines +17 to +18
if (window.debugging === "all" || window.debugging?.includes("podman"))
console.debug("podman", system ? "system" : "user", ...args);
Copy link
Contributor

Choose a reason for hiding this comment

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

These 2 added lines are not executed by any test. Details

@martinpitt
Copy link
Member Author

Very good, the test passed 3x everywhere. Some other flakes which I'll look at next, but they are unrelated. Retrying.

@martinpitt martinpitt requested a review from jelly July 3, 2023 14:56

import cockpit from 'cockpit';
import { useDialogs } from "dialogs.jsx";

import * as client from './client.js';
Copy link
Member

Choose a reason for hiding this comment

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

wondering if eslint can group imports but eh, that's unrelated!

@@ -1229,6 +1229,7 @@ class TestApplication(testlib.MachineCase):
if not auth:
# Check that the checkpoint option is not present for rootless
b.click(f"#containers-containers tbody tr:contains('{IMG_BUSYBOX}') .pf-v5-c-dropdown__toggle")
b.wait_visible(self.getContainerAction(IMG_BUSYBOX, 'Force stop'))
Copy link
Member

Choose a reason for hiding this comment

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

Typo in commit message "hvae" => "have" but fine to merge.

@jelly jelly merged commit 4ba8fc1 into cockpit-project:main Jul 3, 2023
@martinpitt martinpitt deleted the fix-testLifecycleOperationsUser branch July 3, 2023 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flake unstable test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants