Skip to content

Add test for feat_req__lifecycle__shutdown_signal - #414

Open
TimoSteuerwaldETAS wants to merge 9 commits into
eclipse-score:mainfrom
etas-contrib:feature/shutdown-signal-fit
Open

Add test for feat_req__lifecycle__shutdown_signal#414
TimoSteuerwaldETAS wants to merge 9 commits into
eclipse-score:mainfrom
etas-contrib:feature/shutdown-signal-fit

Conversation

@TimoSteuerwaldETAS

Copy link
Copy Markdown
Contributor

Part of #317
Test which verifies that the Launch Manager shuts a process down by sending a SIGTERM and, if the process does not terminate itself in time, escalates to a SIGKILL.

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: 85c211a7-b65b-4a09-af74-d981b21636b5
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (46 packages loaded, 10 targets configured)

Analyzing: target //:license-check (90 packages loaded, 10 targets configured)

Analyzing: target //:license-check (143 packages loaded, 719 targets configured)

Analyzing: target //:license-check (158 packages loaded, 5156 targets configured)

Analyzing: target //:license-check (165 packages loaded, 9348 targets configured)

Analyzing: target //:license-check (170 packages loaded, 9397 targets configured)

Analyzing: target //:license-check (174 packages loaded, 11409 targets configured)

INFO: Analyzed target //:license-check (175 packages loaded, 11535 targets configured).
[12 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox ... (2 actions running)
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 22.263s, Critical Path: 2.13s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

Comment thread tests/integration/shutdown_signal/BUILD Outdated
Comment thread tests/integration/shutdown_signal/control_daemon_mock.cpp
Comment thread tests/integration/shutdown_signal/shutdown_signal_process.cpp Outdated
Comment thread tests/integration/shutdown_signal/shutdown_signal.json
Comment thread tests/integration/shutdown_signal/shutdown_signal_process.cpp
Comment thread tests/integration/shutdown_signal/shutdown_signal.py Outdated
Comment thread tests/integration/shutdown_signal/shutdown_signal_process.cpp Outdated
Comment thread tests/integration/shutdown_signal/shutdown_signal.py Outdated
Comment thread tests/integration/shutdown_signal/common.hpp Outdated
static constexpr char suffix[] = " in signal handler\n";
static_cast<void>(write(STDERR_FILENO, prefix, sizeof(prefix) - 1));
static_cast<void>(write(STDERR_FILENO, path.data(), path.size()));
static_cast<void>(write(STDERR_FILENO, suffix, sizeof(suffix) - 1));

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.

I think if we just exit it would fail the test and in the python you don't need to assert for this message. If we are in a case that open failed it's possible the write could also be flaky?

@danth danth Aug 6, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

See #414 (comment), it seems like exit is not enough.

However it is indeed possible that the write could also fail.

Perhaps, the python code should check whether the process is still running, rather than trying to have the process itself report whether it was killed.

@TimoSteuerwaldETAS TimoSteuerwaldETAS Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In Python code it is checked if file system error happened, which is a rare bad case. Everything else is verified in control_daemon.cpp.
If I understand you correctly you suggest to get rid of all the files and let Python check if the process is still there. Still we need to verify that sigterm has been received, so partly we would still stick to writing files. So for sigterm we would use file approach, but for sigkill Python.

This is why I would like to stick to the current solution. I fear searching for child process PID in Python code is a more complex solution and it would move a relevant part of the test to the python code, which would make it special compared to most of the other tests.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about, on SIGTERM, the process calls getpid and writes it to some file. After SIGKILL should have been sent, the test reads the file. If the file does not exist, the test fails, indicating that SIGTERM was not sent. Otherwise, it has an easy way to find the child process and verify that it is gone.

getpid, open and write are all signal safe. The PID can just be written as raw bytes, no need to encode it to a string.

it would move a relevant part of the test to the python code, which would make a difference compared to most of the other tests

It could also be done in control_daemon_mock.cpp instead of Python


Maybe it is too unlikely to actually matter. But I think it would be nice if the test cannot pass as the result of an error.

Comment thread tests/integration/shutdown_signal/shutdown_signal.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

4 participants