Skip to content

[GUI] Make develop's test jobs pass again: three repairs - #1062

Open
arnodelorme wants to merge 6 commits into
developfrom
agent/issue-733-merge-menu-test
Open

arnodelorme wants to merge 6 commits into
developfrom
agent/issue-733-merge-menu-test

Conversation

@arnodelorme

@arnodelorme arnodelorme commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Develop's test jobs fail on all four platforms since December 1, 2026, for three unrelated reasons, so every open pull request shows red checks. This pull request repairs the three. Two are tests, one is a one-line change in the comments figure.

Failure on develop (068ad174) Platform Since Repair
test_stream11_datasets.py::test_f42_merge_opens_newset_and_cancel_preserves_datasets (2 failed, 2 errors) all four #904 The test follows the EEGLAB flow of the Append datasets dialog: no window title, the user types 1 2.
test_gui_geometry.py::test_runica_width_follows_first_visible_algorithm_only (assert 1816 < 1440) Windows the pop_runica cases The test only needs the two labels to give different widths. Which one is wider depends on the font, and the runner has none.
Segmentation fault in test_pop_editeventvals.py, the job stops at 63% Ubuntu, Python 3.13 #929 qt_comments.py reads the size of the primary screen instead of asking the dialog for its screen.
The Python 3.13 crash: how it was found

Reproduced on jamming with Python 3.13.18 and the locked packages (PySide6 6.11.0). The smallest run that crashes is pytest tests/test_plugin_menu.py tests/test_pop_comments.py::test_comments_figure_resizes_like_matlab tests/test_pop_editeventfield_current.py. The crash is in Qt, at the next QDialog() built after the comments figure of #929 was destroyed:

QScreen::virtualSiblings() const
QGuiApplication::screenAt(QPoint const&)
QWidget::screen() const
QWidget::metric(QPaintDevice::PaintDeviceMetric) const
QFont::QFont(QFont const&, QPaintDevice const*)
QWidgetPrivate::init(QWidget*, QFlags<Qt::WindowType>)
QDialog::QDialog(QWidget*, QFlags<Qt::WindowType>)

It needs the call dialog.screen() in build_comments_figure: with the primary screen read from the application the same run passes, and so does the whole suite (no crash in a full Python 3.13 run on jamming, where the earlier run stopped at 63%). A dialog that is not shown yet is on the primary screen, so the size of the comments figure does not change. Why Qt keeps a dangling screen there is not established: the same call on an ordinary dialog (qt.py, _apply_spec_size) does not crash, a standalone script that repeats the test does not crash, and defining the dialog class once instead of at every call did not help. It does not occur with Python 3.12, on macOS or on Windows.

How the two test failures were found, and the checks

git bisect --first-parent between cea86f8f and develop gives the merge of #904 (f0537673) for the Append datasets test: #904 gave the dialog what EEGLAB has (no title, one proposed dataset) and the menu test still looked for "pop_mergeset" in the title.

In supergui.m a text more than three times wider than its cell is left out of the figure width. With the wide fallback font of the Windows runner the longer pop_runica label passes that limit, so the window with the longer label is the narrower one (1440 against 1816 pixels). The two assertions that matter (the width follows the first label, whichever is selected) are unchanged.

On the Mac: tests/test_stream11_datasets.py, tests/test_gui_geometry.py and tests/test_pop_comments.py pass (208 passed, 85 skipped, then 9 passed). On jamming, Python 3.13: the full suite runs to the end with this branch.

Part of #733

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.

Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.

@claude

claude Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @arnodelorme's task in 29s —— View job


Code review

  • Overall assessment: Looks good. This changes only the test. The handler now finds the Append datasets dialog by its object name and types the two datasets to append, so it matches the dialog as [GUI] Match the Append datasets dialog to EEGLAB #904 left it.
  • Highest-risk area: The test's dialog-handling fixture now sees a window with an empty title. It still handles it correctly (see below).
  • Merge recommendation: Safe to merge.

Blocking

None.

Important

None.

Nits

None.

Test gaps

None.

EEGLAB parity notes

None. Points checked:

  • pop_mergeset_dialog_spec sets title="" and function_name="pop_mergeset" (src/eegprep/functions/popfunc/pop_mergeset.py:74-76). The Qt renderer copies function_name into the window's object name (src/eegprep/functions/guifunc/qt.py:224), so dialog.objectName() == "pop_mergeset" is a reliable check.
  • The text box has tag="indices" (pop_mergeset.py:83). _default_indices_text proposes only the first non-empty dataset (pop_mergeset.py:113-117), so the test has to type 1 2, as an EEGLAB user would.
  • An empty title doesn't break the dialogs fixture. It only records titles that are non-empty (tests/test_stream11_datasets.py:58-59) and avoids answering the same window twice through _dialog_identity. seen gets "" for the merge dialog, and the test checks only len(seen) == 2.
  • QLineEdit is already imported (tests/test_stream11_datasets.py:11).
  • The new comment explains why the test matches EEGLAB, which AGENTS.md allows.
  • No source or numerical change, so no MATLAB reference run is needed.

Checked for correctness bugs, EEGLAB parity, data structure compatibility, changed-behavior tests, and CLAUDE.md/AGENTS.md compliance. I did not run the tests in this session; I reviewed the code and the fixture logic.

@arnodelorme arnodelorme changed the title [GUI] Repair the Append datasets menu test, red on develop since #904 [GUI] Make develop's test jobs pass again: three repairs Dec 2, 2026
@neuromechanist

Copy link
Copy Markdown
Member

Three follow-up commits from review:

  • ce0bd54a0: the comment in qt_comments.py no longer explains the workaround; it states the intent and points to Python 3.13 Qt segfault after QWidget.screen() on the comments figure #1063, which now holds the Python 3.13 reproduction, the Qt stack, the open question of the cause, and the remaining screen() call in qt.py (_apply_spec_size).
  • 6c5c18f88: test_f42_merge_opens_newset_and_cancel_preserves_datasets now checks that the Append datasets window proposes dataset 1, as EEGLAB's pop_mergeset does, before typing 1 2.
  • 2bd34aa5e: new test_comments_figure_fits_the_screen builds the comments figure under offscreen Qt (800x600) and checks that it fits the primary screen's available geometry. With the shrink-to-fit disabled locally it fails (1394 <= 800); with it, it passes.

Checks (macOS, offscreen Qt): tests/test_pop_comments.py, tests/test_stream11_datasets.py and tests/test_gui_geometry.py give 218 passed, 85 skipped; ruff check, ruff format and ./pre-commit.py pass. The full suite was not run locally.


Agentic AI tools were used. Workflows follow the Research Skills (doi:10.5281/zenodo.20696515). The author assumes full responsibility for this content and associated changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants