Skip to content

Conversation

@jbachorik
Copy link
Collaborator

@jbachorik jbachorik commented May 23, 2025

What does this PR do?:
This adds a smoke test for the crash-recovery mechanism used in the 'vm' stackwalker

Motivation:
A followup for bugfix #214

How to test the change?:
The test runs automatically

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.
  • JIRA: PROF-11839

Unsure? Have a question? Request a review!

@jbachorik jbachorik requested a review from MattAlp May 23, 2025 15:48
@github-actions
Copy link

github-actions bot commented May 23, 2025

🔧 Report generated by pr-comment-cppcheck

CppCheck Report

Errors (2)

Warnings (4)

Style Violations (295)

@jbachorik jbachorik requested a review from zhengyu123 May 23, 2025 15:48
@github-actions
Copy link

github-actions bot commented May 23, 2025

🔧 Report generated by pr-comment-scanbuild


#ifdef DEBUG
#include <signal.h>
static const char* force_stackwalk_crash_env = getenv("DDPROF_FORCE_STACKWALK_CRASH");
Copy link
Contributor

Choose a reason for hiding this comment

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

simple but efficient 👍


public abstract class AbstractProcessProfilerTest {
protected final boolean launch(String target, List<String> jvmArgs, String commands, Function<String, Boolean> onStdoutLine, Function<String, Boolean> onStderrLine) throws Exception {
public static final class LaunchResult {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice to see we are investing in controlled behaviour tests.
If we want to extend these, we could discuss what would be a good structure.
Nothing blocking though it is hard to see the structure. I would expect something like:

TestProcessController controller = new TestProcessController(WorkloadType.CPU_INTENSIVE);
controller.launch();
controller.waitForReady();
controller.sendStartSignal();
controller.waitForWorkingOutput();
controller.assertProfilerDidX();
controller.shutdown();

I think we basically have different parts

  • controller
  • assertions
  • workload
  • protocol

Copy link
Contributor

@r1viollet r1viollet left a comment

Choose a reason for hiding this comment

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

LGTM

@jbachorik jbachorik force-pushed the jb/crashhandler_test branch from bcb1591 to ac3cd0d Compare May 27, 2025 11:38
@jbachorik jbachorik merged commit 7c42650 into main May 27, 2025
92 of 93 checks passed
@github-actions github-actions bot added this to the 1.27.0 milestone May 27, 2025
@jbachorik jbachorik deleted the jb/crashhandler_test branch May 28, 2025 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants