Repository navigation
Split the long UI tests into focused tests, and fix the memory leaks this exposed - #231
Merged
Merged
Conversation
The 107-assertion scenario becomes seven tests (drawing, hiding and showing, nesting, rebuilding after an image change, deleting, changing the category, tags) that build only the state they need through shared helpers. Fix: the object tree's preview pop-over no longer opens after its window was closed (its timer could still fire, e.g. between UI tests).
The 87-assertion polygon scenario becomes seven tests (drawing, finishing, switching images, editing vertices, deleting, changing the drawing mode, adding and deleting vertices), and the freehand test two (while drawing, after finishing).
The 57-assertion scenario becomes six tests: drawing, switching images, moving, opening another folder (error report and reset), resizing, and exiting with unsaved annotations.
The 64-assertion scenario becomes five tests: opening the inference settings, the controls shown when inference is enabled, their default values, cancelling changes, and applying invalid settings.
The scenario becomes six tests: the registered shortcuts, navigation, drawing modes, the settings and focus shortcuts, and the shape shortcuts with one and with several polygons.
The scenario becomes three tests: filtering by annotation status (with navigation), filtering by categories until the filter is cleared, and searching file names.
UI tests show each new Controller in the same TestFX window. Every Controller left its event filters and handlers on that window and its autosave thread running, so all earlier apps (with their images) stayed in memory. With the split UI tests the test JVM ran out of heap and JavaFX stopped processing events, which hung the full test suite. The Controller now removes its handlers from the window once it is hidden, and stopping the autosave ends its thread (deletions still work afterwards). The app itself has one Controller per window, so it wasn't affected.
From the menu bar the pointer now goes straight down into the menu (a diagonal move crossed the next menu-bar button, which switches menus while one is open), into a submenu straight across at the parent item's height (the robot's reported pointer position was wrong), and the item is looked up again after entering a submenu, which can rebuild it.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #231 +/- ##
============================================
+ Coverage 90.24% 90.32% +0.07%
- Complexity 2384 2393 +9
============================================
Files 140 140
Lines 8964 8988 +24
Branches 860 863 +3
============================================
+ Hits 8090 8118 +28
+ Misses 455 451 -4
Partials 419 419 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Splits the 7 long UI test scenarios that SonarCloud flagged (S5961, 26–107 assertions each) into focused tests, and fixes the two memory leaks and the menu helper problems that this exposed.
Split tests (one commit per class)
ObjectTreeTestsBoundingPolygonDrawingTestsBoundingBoxDrawingTestsSettingsTests(inference)SceneKeyShortcutTestsImageFileFilterTestsEach test builds only the state it needs through shared helpers (e.g. drawing two boxes, building a nested tree, opening the inference settings). The steps and checks are the ones from the old scenarios.
Memory leaks (the full suite hung locally)
Controllerin the same TestFX window.Controllerleft its event filters and handlers on that window, and its autosave thread running (Autosave unexported annotations and offer to restore them #226/Move the autosave logic from Controller into AutosaveController #228), so every earlier app stayed in memory with its images.Controllers still reachable afterObjectTreeTests, through the window's event handlers.Controllerremoves its handlers from the window once the window is hidden.AutosaveController.stop()ends the autosave thread. Deletions still work afterwards; saves are ignored.Controllerper window.Controlleris left. The full suite (336 tests) passes in about 6 minutes with no full GCs.Menu path helper (#227)
Also: the object tree's preview pop-over no longer opens after its window was closed. Its timer could still fire, which TestFX reported as a failure in the next test.