-
Notifications
You must be signed in to change notification settings - Fork 0
fix(exec): preserve child exit code when OTLP export fails (#360) #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -568,6 +568,32 @@ var suites = []FixtureSuite{ | |
| }, | ||
| }, | ||
| }, | ||
| // #360: exec child exit code should propagate even when OTLP export fails | ||
| { | ||
| { | ||
| Name: "#360 exec child exit code preserved when export fails", | ||
| Config: FixtureConfig{ | ||
| CliArgs: []string{"exec", | ||
| "--endpoint", "{{endpoint}}", | ||
| "--timeout", "100ms", | ||
| "--", "/bin/sh", "-c", "exit 42", | ||
| }, | ||
| StopServerBeforeExec: true, | ||
| TestTimeoutMs: 2000, | ||
| IsLongTest: true, | ||
| }, | ||
| Expect: Results{ | ||
| Config: otelcli.DefaultConfig(), | ||
| }, | ||
| CheckFuncs: []CheckFunc{ | ||
| func(t *testing.T, f Fixture, r Results) { | ||
| if r.ExitCode != 42 { | ||
| t.Errorf("expected exit code 42 from child process, got %d", r.ExitCode) | ||
| } | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
|
Comment on lines
+571
to
+596
|
||
| // otel-cli span with no OTLP config should do and print nothing | ||
| { | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coding
/bin/shmakes this fixture non-portable (e.g., Windows runners). If CI/test execution targets multiple OSes, consider using an OS-appropriate command (or a small helper test binary) or adding a runtime/platform skip/guard in the fixture system for non-POSIX environments.