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

lib: Add error message when showing multiple Dialogs #19595

Merged
merged 2 commits into from
Nov 10, 2023

Commits on Nov 10, 2023

  1. test: Close modal in TestSystemInfo.testCryptoPolicies

    Close the crypto policy dialog after checking the default value. Leaving
    it open and clicking around on the main page is cheating and prone to
    race conditions, and will fail with the next commit.
    martinpitt committed Nov 10, 2023
    Configuration menu
    Copy the full SHA
    3617fd7 View commit details
    Browse the repository at this point in the history
  2. lib: Add error message when showing multiple Dialogs

    With human user/browser interaction there can only ever be one Modal
    dialog at a time. However, our tests/CDP driver does not have that
    restriction, tests can happily click on main page buttons while a dialog
    is open.
    
    This can lead to situations where a test opens a dialog, and then opens
    a second one (which will overwrite `WithDialogs.Dialog.dialog` with the
    new component) without waiting for the first one to close. Then when the
    first dialog handler finally calls `.close()`, it will unexpectedly
    close the *second* dialog instead.
    
    These races are a pain to debug [1]. Make them obvious with an error message
    which shows both the old and the new dialog element. As our tests now
    fail on console.errors(), that will detect/prevent similar race
    conditions in our tests.
    
    [1] cockpit-project/cockpit-machines#1292
    martinpitt committed Nov 10, 2023
    Configuration menu
    Copy the full SHA
    9c91eb5 View commit details
    Browse the repository at this point in the history