Skip to content

cockpit-ci: Update container to 2026-05-16; Use cockpit.location.go() for URL-based container switching#2541

Merged
jelly merged 2 commits into
mainfrom
tasks-container-update-cockpit-ci-container-20260518-060330
May 21, 2026
Merged

cockpit-ci: Update container to 2026-05-16; Use cockpit.location.go() for URL-based container switching#2541
jelly merged 2 commits into
mainfrom
tasks-container-update-cockpit-ci-container-20260518-060330

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 18, 2026

@github-actions github-actions Bot added the bot label May 18, 2026
@github-actions github-actions Bot changed the title [no-test] cockpit-ci: Update container to 2026-05-16 cockpit-ci: Update container to 2026-05-16 May 18, 2026
jelly pushed a commit that referenced this pull request May 18, 2026
@jelly jelly force-pushed the tasks-container-update-cockpit-ci-container-20260518-060330 branch from e350b0d to e112808 Compare May 18, 2026 06:03
@martinpitt martinpitt moved this to detriment in Pilot tasks May 19, 2026
@martinpitt martinpitt self-assigned this May 19, 2026
@martinpitt
Copy link
Copy Markdown
Member

The firefox failure reproduces effortlessly with

TEST_BROWSER=firefox test/check-application TestApplication.testBasicUser -stv $RUNC
  • I don't get the "AllowWebgl2:false restricts context creation on this system" error message locally, that's apparently a red herring and only happens in CI.
  • The "TypeError: WeakMap key null must be an object or an unregistered symbol" is also a red herring, it happens way before the time of error.
  • There are no browser errors with the failing command (b.click(busybox_sel + " td.pf-v6-c-table__toggle button")
  • The screenshot is misleading -- it's the cleanup that happens to kill the session, at the time of failure I still see the cockpit UI.
  • At the time of the failure, the "Images" card is not expanded. The test expects that. When I expand it manually (in TEST_SHOW_BROWSER=1), the test continues normally and succeeds. It is expanded when running with Chromium.

The critical step is

        b.go("#/?container=all")

in line 842. With the new firefox this triggers a page reload, which resets the expanded state of "Images".

I'll push a fix, but looking at the other tests still.

@martinpitt
Copy link
Copy Markdown
Member

This affects more tests. Editing the URL in the interactive browser does not reload the page. Our ph_go() implementation sets window.location.hash which somehow triggers this.

I noticed that we call ph_go() in frame context, which strikes me as odd:

info: XXX ph_go #/?owner=0 setting window.location.hash {"href":"http://127.0.0.2:9091/cockpit/@localhost/podman/index.html#/","origin":"http://127.0.0.2:9091","protocol":"http:","host":"127.0.0.2:9091","hostname":"127.0.0.2","port":"9091","pathname":"/cockpit/@localhost/podman/index.html","search":"","hash":"#/","ancestorOrigins":{"0":"http://127.0.0.2:9091"}}

This isn't something that a user could ever do interactively, and is cheating. Instead of fixing/replacing b.go() calls, I tried changing go() to change the actual top-level URL:

    def go(self, url_hash: str) -> None:
        with self.driver.restore_context():
            self.switch_to_top()
            self.call_js_func('ph_go', url_hash)

This passes test/check-application TestApplication.testBasicUser $RUNC for both Firefox and Chromium, but still fails testBasicSystem, as the top-level URL change does not propagate to the frame properly.

This phenomenon also explains this kind of failure in cockpit-project/cockpit#23277 -- the unexpected page load causes the "ph_texts not defined" error, as at that point we don't wait for a page load.

So let's instead try to fix Browser.go() properly. I have a local implementation which fixes both the podman and the cockpit tests.

martinpitt pushed a commit that referenced this pull request May 20, 2026
@martinpitt martinpitt force-pushed the tasks-container-update-cockpit-ci-container-20260518-060330 branch from e112808 to 6c3b96f Compare May 20, 2026 11:48
@martinpitt
Copy link
Copy Markdown
Member

martinpitt commented May 20, 2026

Still several test failures now. But we really need to fix these screenshots, they are absolutely useless when they happen after cleanup.

Update: fixed in #2547

@martinpitt
Copy link
Copy Markdown
Member

The TestApplication.testRunImageUser failure reproduces locally, and it's 100% stable. Once again, clicking on the container link in the images table with firefox reloads the page. The browser bug is well known by now, it updates the URL to add an anchor /podman#123abc). This even happens with an interactive click in the browser, so this time it's not a test issue any more.

martinpitt and others added 2 commits May 20, 2026 16:02
This will pick up the Firefox hack for
<https://bugzilla.mozilla.org/show_bug.cgi?id=2018546>, i.e. avoids a
page reload when clicking on the "Used by:" links. (This wasn't a test
issue -- human clicks did the same.)

`cockpit.location.go()` adds an extra `/` after the hash. Adjust the
consumer and test accordingly.
@martinpitt martinpitt force-pushed the tasks-container-update-cockpit-ci-container-20260518-060330 branch from 6c3b96f to b707d4f Compare May 20, 2026 14:02
@martinpitt martinpitt changed the title cockpit-ci: Update container to 2026-05-16 cockpit-ci: Update container to 2026-05-16; Use cockpit.location.go() for URL-based container switching May 20, 2026
@martinpitt martinpitt requested review from jelly and tomasmatus May 20, 2026 15:07
@jelly jelly merged commit eef3b99 into main May 21, 2026
38 checks passed
@jelly jelly deleted the tasks-container-update-cockpit-ci-container-20260518-060330 branch May 21, 2026 11:38
@github-project-automation github-project-automation Bot moved this from detriment to improvement in Pilot tasks May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants