Repository navigation
Conversation
This branch has not been deployed
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.
Fixes #469
Root Cause
When launching the configuration wizard from an active Prismatik instance (
SettingsWindow::onRunConfigurationWizard_clicked()), a newPrismatik --wizardprocess is started while the existing instance exits. InLightpackApplication::processCommandLineArguments(), ifisRunning()is still true while the previous instance tears down, the loop calledQThread::sleep(200);.Because
QThread::sleeptakes seconds rather than milliseconds, each iteration slept for 200 seconds (~3.3 minutes) instead of 200 ms, making the wizard appear to hang after the main window and tray icon closed (and spinning indefinitely if the previous instance failed to exit).Changes
Software/src/WizardWaitHelper.hpp(registered inSoftware/src/src.proandSoftware/tests/tests.pro):WizardWaitHelper::waitForInstanceQuit(...)with default 10 s timeout (kDefaultQuitTimeoutMs = 10000) and 200 ms poll interval (kDefaultPollIntervalMs = 200).Software/src/LightpackApplication.cpp:<QElapsedTimer>,<QThread>,<cstdint>,<cstdlib>, and"WizardWaitHelper.hpp".QThread::sleep(200);withWizardWaitHelper::waitForInstanceQuit(...)usingQElapsedTimerandQThread::msleep(200).qWarning(), surface the error viaoutputMessage(...)(so Windows GUI launches also display the message box without openingLogWriterwhile the old instance still holdsPrismatik.0.log), and exit via::exit(WizardQuitTimeout_ErrorCode).Software/src/LightpackApplication.hpp:WizardQuitTimeout_ErrorCode = 6toLightpackApplication::ErrorCodes.Software/tests/LightpackCommandLineParserTest.{hpp,cpp}:testCase_wizardWaitImmediateExit,testCase_wizardWaitExitAfterPolls,testCase_wizardWaitTimeout) covering immediate exit (0 sleeps), exit after N polls (including exact timeout boundary during final sleep), and timeout expiry (both default 10 s and 0 ms timeout).Verification
PrismatikandLightpackTestswithqmake6 -r && make -j2on Linux (Qt 6.8.2) with zero warnings on the modified files.QT_QPA_PLATFORM=offscreen ./bin/LightpackTests: all 8 test suites passed (0 failed,0 skipped;LightpackCommandLineParserTest: 12 passed).