Skip to content
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

test_get_named_events: Don't try and maintain the set of all possible perf stat keys here. #158

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

wash-amzn
Copy link
Contributor

When I ran the tests on a codebuild github runner (I don't actually know the instance type because they don't let you choose), this test was failing. I modified it to dump the event keys, and the failure was because data-st-tlb-mpki and data-st-tlb-tw-pki were being returned, but hadn't been added to this test's allow-list.

The values that the test failure saw

Event values: ["ipc", "stall-frontend-pkc", "branch-mpki", "inst-tlb-mpki", "inst-tlb-tw-pki", "inst-l1-mpki", "stall-backend-pkc", "l3-mpki", "l2-mpki", "data-tlb-mpki", "data-tlb-tw-pki", "data-l1-mpki", "data-st-tlb-mpki", "data-st-tlb-tw-pki", "ipc", "stall-frontend-pkc", "branch-mpki", "inst-tlb-mpki", "inst-tlb-tw-pki", "inst-l1-mpki", "stall-backend-pkc", "l3-mpki", "l2-mpki", "data-tlb-mpki", "data-tlb-tw-pki", "data-l1-mpki", "data-st-tlb-mpki", "data-st-tlb-tw-pki"]

and failed with

thread 'data::perf_stat::tests::test_get_named_events' panicked at src/data/perf_stat.rs:620:21:
assertion failed: key_map.contains_key(&event.to_string())

Instead of trying to maintain a superset of all possible keys in the test, now it just asserts for a simple case (ipc) and doesn't try to defend against 'unexpected' ones.

This now passes on those codebuild github runners.

test data::perf_stat::tests::test_get_named_events ... ok

… perf stat keys here.

There are many of them spread across multiple files. Instead, only assert that an expected-in-all-cases (I used 'ipc') key is present.
@wash-amzn wash-amzn requested a review from a team as a code owner April 23, 2024 15:19
@janaknat janaknat merged commit fb135b5 into aws:main Apr 23, 2024
8 checks passed
@wash-amzn wash-amzn deleted the perf-stat-test-changes branch December 10, 2024 14:41
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.

2 participants