Skip to content

Update perf_profiler_bpf_test to use UnitConnector.#1283

Merged
JamesMBartlett merged 3 commits intopixie-io:mainfrom
etep:ddh-convert-perf-profiler-test-cases-to-unit-connector
May 9, 2023
Merged

Update perf_profiler_bpf_test to use UnitConnector.#1283
JamesMBartlett merged 3 commits intopixie-io:mainfrom
etep:ddh-convert-perf-profiler-test-cases-to-unit-connector

Conversation

@etep
Copy link
Copy Markdown

@etep etep commented May 4, 2023

Summary: we convert perf_profiler_bpf_test to use UnitConnector to share code across different tests and binaries.

We also refactor the Java test case to separately test the expectation that Java symbolization artifacts are removed after processes stop. The main Java test case then conforms to the pattern established for Go and cpp.

We also update some of the helper functions in the test to tidy up the common test cases.

Type of change: /kind cleanup

Test Plan: existing tests & runs per test.

  • bazel test //src/stirling/source_connectors/perf_profiler/... --config bpf --runs_per_test 16 (all tests passed).

@etep etep requested review from a team and ddelnano May 4, 2023 00:20
Comment thread src/stirling/source_connectors/perf_profiler/perf_profiler_bpf_test.cc Outdated
Comment thread src/stirling/source_connectors/perf_profiler/perf_profiler_bpf_test.cc Outdated
Comment thread src/stirling/source_connectors/perf_profiler/perf_profiler_bpf_test.cc Outdated
Comment thread src/stirling/source_connectors/perf_profiler/perf_profiler_bpf_test.cc Outdated
@etep etep marked this pull request as draft May 4, 2023 15:19
Signed-off-by: Pete Stevenson <jps@pixielabs.ai>
@etep etep force-pushed the ddh-convert-perf-profiler-test-cases-to-unit-connector branch from 091704f to fd698ee Compare May 5, 2023 22:05
Pete Stevenson added 2 commits May 5, 2023 15:06
Signed-off-by: Pete Stevenson <jps@pixielabs.ai>
Signed-off-by: Pete Stevenson <jps@pixielabs.ai>
@etep etep marked this pull request as ready for review May 5, 2023 22:12
@etep etep requested a review from a team May 8, 2023 20:15
std::vector<std::unique_ptr<ContainerRunner>> sub_processes_;
};

template <bool FastTest>
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.

Could you explain fast tests vs slow tests? I don't really understand what we're trying to achieve with the distinction.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The "slow" test accepts all the default profiler parameters, but with the 30 sec. data sampling periodicity, the test inherently runs slower. The "fast" test overrides the defaults, but the test case will complete in less time. At some point in the history, we had (or were going toward) all tests using the "fast" methodology but a reviewer suggested that we keep at least one test with the slow/default setup. This PR does not change the existing setup, but it does provide a nicer way to identify which test is in which category by naming the templated test fixtures accordingly.

@JamesMBartlett JamesMBartlett merged commit 093d66e into pixie-io:main May 9, 2023
ddelnano pushed a commit to k8sstormcenter/pixie that referenced this pull request Feb 25, 2026
Summary: we convert `perf_profiler_bpf_test` to use `UnitConnector` to
share code across different tests and binaries.

We also refactor the Java test case to separately test the expectation
that Java symbolization artifacts are removed after processes stop. The
main Java test case then conforms to the pattern established for Go and
cpp.

We also update some of the helper functions in the test to tidy up the
common test cases.

Type of change: /kind cleanup

Test Plan: existing tests & runs per test.
- [x] `bazel test //src/stirling/source_connectors/perf_profiler/...
--config bpf --runs_per_test 16` ([all tests
passed](https://phab.corp.pixielabs.ai/P372)).

---------

Signed-off-by: Pete Stevenson <jps@pixielabs.ai>
ddelnano pushed a commit to k8sstormcenter/pixie that referenced this pull request Feb 25, 2026
Summary: we convert `perf_profiler_bpf_test` to use `UnitConnector` to
share code across different tests and binaries.

We also refactor the Java test case to separately test the expectation
that Java symbolization artifacts are removed after processes stop. The
main Java test case then conforms to the pattern established for Go and
cpp.

We also update some of the helper functions in the test to tidy up the
common test cases.

Type of change: /kind cleanup

Test Plan: existing tests & runs per test.
- [x] `bazel test //src/stirling/source_connectors/perf_profiler/...
--config bpf --runs_per_test 16` ([all tests
passed](https://phab.corp.pixielabs.ai/P372)).

---------

Signed-off-by: Pete Stevenson <jps@pixielabs.ai>
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