Add tests which are verifying comp_req__launch_man__launcher_exit_shutdown - #450
Add tests which are verifying comp_req__launch_man__launcher_exit_shutdown#450TimoSteuerwaldETAS wants to merge 21 commits into
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
f064618 to
bee9de9
Compare
|
The created documentation from the pull request is available at: docu-html |
66c58a4 to
3494414
Compare
3494414 to
3f23834
Compare
These commits have been squashed together to ease review. After cherry pick some conflicts have been solved wrong, this is why there are two additional commits also. For details please also have a look onto the internal branch in etas-eng feature/create-process-launch-fit-specification-unverified The original commit message of this commit: Add a log message for SIGTERM receival Move dir tests/integration/lm_shutdown to tests/integration/lm_shutdown_during_rt_switch Update references accordingly Add lm_shutdown_during_switch_to_off A test which verifies that a launch manager shutdown signalled via SIGTERM does not cancel existent switches to off. Currently does not fail, but should fail. As switch to off gets cancelled and reinitiated by launch manager code. Let test fail, as switch to off is cancelled by lm Revert to 1s timeout for lm shutdown & add some comments Still not 100% stable. Fix cherry pick odyssey Former fix for SIGSEGV of old branch
Other ControlClientMocks need to be updated separately.
98dcd34 to
63c02af
Compare
| # Run the launch manager until component_a signals it is stalling mid-termination | ||
| # (file `component_a_terminating`): the switch to run_target_c is then in progress | ||
| # but run_target_c has not been activated yet. run_until_file_deployed stops the | ||
| # launch manager at that point by sending it a SIGTERM (to the launch manager | ||
| # process only, so it performs its own orderly shutdown) and asserts it exits | ||
| # cleanly (code 0). |
There was a problem hiding this comment.
| # Run the launch manager until component_a signals it is stalling mid-termination | |
| # (file `component_a_terminating`): the switch to run_target_c is then in progress | |
| # but run_target_c has not been activated yet. run_until_file_deployed stops the | |
| # launch manager at that point by sending it a SIGTERM (to the launch manager | |
| # process only, so it performs its own orderly shutdown) and asserts it exits | |
| # cleanly (code 0). | |
| # Run until `component_a_terminating` is deployed so we can request shutdown during | |
| # the transition to run target c |
| // TODO: adopt this in the remaining tests/integration/*/*control*.cpp binaries | ||
| // that still wait with a bare pause(). |
There was a problem hiding this comment.
Do we have a Github issue for this? We could make sure we have one and remove this TODO.
WilliamRoebuck
left a comment
There was a problem hiding this comment.
Looks good now, my only remaining concerns are the core dump and test wait changes
| # Run the launch manager until component_a signals it is stalling mid-termination | ||
| # (file `component_a_terminating`): the explicit switch to Off is then in progress. | ||
| # run_until_file_deployed stops the launch manager at that point by sending it a | ||
| # SIGTERM (to the launch manager process only, so it performs its own orderly | ||
| # shutdown) and asserts it exits cleanly (code 0). |
There was a problem hiding this comment.
| # Run the launch manager until component_a signals it is stalling mid-termination | |
| # (file `component_a_terminating`): the explicit switch to Off is then in progress. | |
| # run_until_file_deployed stops the launch manager at that point by sending it a | |
| # SIGTERM (to the launch manager process only, so it performs its own orderly | |
| # shutdown) and asserts it exits cleanly (code 0). | |
| # Run until `component_a_terminating` is deployed so we can send SIGTERM | |
| # to launch manager during the transition to Off |
| ``` | ||
| The default `core_pattern` differs per system (e.g. `|/wsl-capture-crash ...` | ||
| on WSL, `|/lib/systemd/systemd-coredump ...` on systemd hosts, or plain | ||
| `core`). Check yours *before* the first run so you know the value to restore. |
There was a problem hiding this comment.
If this is important to do before running, we should put this operation under a config flag I think. Its very unlikely that anyone will see this before they run tests the first time (after this PR)
| /// @brief How long the process stalls while being terminated, keeping an in-progress | ||
| /// run-target switch alive so the test has a deterministic window to send SIGTERM to | ||
| /// the launch manager. Must be smaller than the configured shutdown_timeout so the |
There was a problem hiding this comment.
| /// @brief How long the process stalls while being terminated, keeping an in-progress | |
| /// run-target switch alive so the test has a deterministic window to send SIGTERM to | |
| /// the launch manager. Must be smaller than the configured shutdown_timeout so the | |
| /// @brief How long the process stalls while being terminated. | |
| /// Must be smaller than the configured shutdown_timeout so the |
| /// Poll the atomic flag instead of calling pause() directly. A process-directed | ||
| /// signal (from kill) is delivered to an arbitrary one of the process's threads | ||
| /// that has the signal unblocked. If the test process has more than one thread | ||
| /// (e.g. a ControlClient, whose constructor spawns a background IPC thread), the | ||
| /// handler may run on a background thread and set exitRequested there. pause() | ||
| /// only returns for a signal handled on the calling thread, so a main thread | ||
| /// blocked in pause() would not wake - it would stay parked until the launch | ||
| /// manager SIGKILLs it at its shutdown_timeout, and never write its XML result. | ||
| /// Polling observes the flag regardless of which thread handled the signal. |
There was a problem hiding this comment.
Ah, but I think that is the key difference. From my testing, a pause on the main thread always takes precedence to pauses on child threads. Though this might be OS dependent. I think this should be a separate issue/PR anyway as it is not needed for this test.
Part of #317
comp_req__launch_man__launcher_exit_shutdown
The
Launch Managershall exit after performing shutdown operation bystopping all the
Processes <Process>it owns in the dependency order when requested.