Fix test flakiness and add timeline coverage (#347)#347
Closed
fengxizhou wants to merge 1 commit into
Closed
Conversation
|
@fengxizhou has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104891668. |
d38af66 to
fd41ee8
Compare
fengxizhou
added a commit
to fengxizhou/HolisticTraceAnalysis
that referenced
this pull request
May 12, 2026
Summary: Fix two root causes of flakiness in `test_timeline.py` and add coverage for uncovered functions in `hta/analyzers/timeline.py`. **Flakiness fixes:** - `get_trace(rank)` returns a direct reference to the internal DataFrame, not a copy. All `setUp` methods and inline calls now use `.copy()` to ensure test isolation — preventing shared mutable state between tests that caused non-deterministic failures depending on execution order. - `test_raises_on_partial_columns` had a silent-pass path: when trace data contained all required columns, the test body never executed. Rewritten to always truncate `cols_present` so the ValueError assertion always fires. **Coverage additions (test_coverage_gaps.py):** - `test_simplify_name_truncates_long_names` — covers truncation path in `_simplify_name` - `test_plot_gpu_kernels_delegates` — covers `plot_timeline_gpu_kernels` (previously 0% coverage) - `test_plot_gpu_kernels_from_trace` — covers `plot_timeline_gpu_kernels_from_trace` (previously 0% coverage) Differential Revision: D104891668
fd41ee8 to
0044c67
Compare
fengxizhou
added a commit
to fengxizhou/HolisticTraceAnalysis
that referenced
this pull request
May 12, 2026
Summary: Fix two root causes of flakiness in `test_timeline.py` and add coverage for uncovered functions in `hta/analyzers/timeline.py`. **Flakiness fixes:** - `get_trace(rank)` returns a direct reference to the internal DataFrame, not a copy. All `setUp` methods and inline calls now use `.copy()` to ensure test isolation — preventing shared mutable state between tests that caused non-deterministic failures depending on execution order. - `test_raises_on_partial_columns` had a silent-pass path: when trace data contained all required columns, the test body never executed. Rewritten to always truncate `cols_present` so the ValueError assertion always fires. **Coverage additions (test_coverage_gaps.py):** - `test_simplify_name_truncates_long_names` — covers truncation path in `_simplify_name` - `test_plot_gpu_kernels_delegates` — covers `plot_timeline_gpu_kernels` (previously 0% coverage) - `test_plot_gpu_kernels_from_trace` — covers `plot_timeline_gpu_kernels_from_trace` (previously 0% coverage) Differential Revision: D104891668
0044c67 to
076f198
Compare
076f198 to
9af410b
Compare
fengxizhou
added a commit
to fengxizhou/HolisticTraceAnalysis
that referenced
this pull request
May 12, 2026
Summary: Fix two root causes of flakiness in `test_timeline.py` and add coverage for uncovered functions in `hta/analyzers/timeline.py`. **Flakiness fixes:** - `get_trace(rank)` returns a direct reference to the internal DataFrame, not a copy. All `setUp` methods and inline calls now use `.copy()` to ensure test isolation — preventing shared mutable state between tests that caused non-deterministic failures depending on execution order. - `test_raises_on_partial_columns` had a silent-pass path: when trace data contained all required columns, the test body never executed. Rewritten to always truncate `cols_present` so the ValueError assertion always fires. **Coverage additions (test_coverage_gaps.py):** - `test_simplify_name_truncates_long_names` — covers truncation path in `_simplify_name` - `test_plot_gpu_kernels_delegates` — covers `plot_timeline_gpu_kernels` (previously 0% coverage) - `test_plot_gpu_kernels_from_trace` — covers `plot_timeline_gpu_kernels_from_trace` (previously 0% coverage) Differential Revision: D104891668
9af410b to
cece533
Compare
fengxizhou
added a commit
to fengxizhou/HolisticTraceAnalysis
that referenced
this pull request
May 13, 2026
Summary: Fix two root causes of flakiness in `test_timeline.py` and add coverage for uncovered functions in `hta/analyzers/timeline.py`. **Flakiness fixes:** - `get_trace(rank)` returns a direct reference to the internal DataFrame, not a copy. All `setUp` methods and inline calls now use `.copy()` to ensure test isolation — preventing shared mutable state between tests that caused non-deterministic failures depending on execution order. - `test_raises_on_partial_columns` had a silent-pass path: when trace data contained all required columns, the test body never executed. Rewritten to always truncate `cols_present` so the ValueError assertion always fires. **Coverage additions (test_coverage_gaps.py):** - `test_simplify_name_truncates_long_names` — covers truncation path in `_simplify_name` - `test_plot_gpu_kernels_delegates` — covers `plot_timeline_gpu_kernels` (previously 0% coverage) - `test_plot_gpu_kernels_from_trace` — covers `plot_timeline_gpu_kernels_from_trace` (previously 0% coverage) Differential Revision: D104891668
cece533 to
8090140
Compare
fengxizhou
added a commit
to fengxizhou/HolisticTraceAnalysis
that referenced
this pull request
May 13, 2026
Summary: Fix two root causes of flakiness in `test_timeline.py` and add coverage for uncovered functions in `hta/analyzers/timeline.py`. **Flakiness fixes:** - `get_trace(rank)` returns a direct reference to the internal DataFrame, not a copy. All `setUp` methods and inline calls now use `.copy()` to ensure test isolation — preventing shared mutable state between tests that caused non-deterministic failures depending on execution order. - `test_raises_on_partial_columns` had a silent-pass path: when trace data contained all required columns, the test body never executed. Rewritten to always truncate `cols_present` so the ValueError assertion always fires. **Coverage additions (test_coverage_gaps.py):** - `test_simplify_name_truncates_long_names` — covers truncation path in `_simplify_name` - `test_plot_gpu_kernels_delegates` — covers `plot_timeline_gpu_kernels` (previously 0% coverage) - `test_plot_gpu_kernels_from_trace` — covers `plot_timeline_gpu_kernels_from_trace` (previously 0% coverage) Differential Revision: D104891668
8090140 to
7a383ec
Compare
Summary: Fix two root causes of flakiness in `test_timeline.py` and add coverage for uncovered functions in `hta/analyzers/timeline.py`. **Flakiness fixes:** - `get_trace(rank)` returns a direct reference to the internal DataFrame, not a copy. All `setUp` methods and inline calls now use `.copy()` to ensure test isolation — preventing shared mutable state between tests that caused non-deterministic failures depending on execution order. - `test_raises_on_partial_columns` had a silent-pass path: when trace data contained all required columns, the test body never executed. Rewritten to always truncate `cols_present` so the ValueError assertion always fires. **Coverage additions (test_coverage_gaps.py):** - `test_simplify_name_truncates_long_names` — covers truncation path in `_simplify_name` - `test_plot_gpu_kernels_delegates` — covers `plot_timeline_gpu_kernels` (previously 0% coverage) - `test_plot_gpu_kernels_from_trace` — covers `plot_timeline_gpu_kernels_from_trace` (previously 0% coverage) Reviewed By: Chenguang-Zhu Differential Revision: D104891668
7a383ec to
3c68035
Compare
|
This pull request has been merged in 3bdde70. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Fix two root causes of flakiness in
test_timeline.pyand add coverage for uncovered functions inhta/analyzers/timeline.py.Flakiness fixes:
get_trace(rank)returns a direct reference to the internal DataFrame, not a copy. AllsetUpmethods and inline calls now use.copy()to ensure test isolation — preventing shared mutable state between tests that caused non-deterministic failures depending on execution order.test_raises_on_partial_columnshad a silent-pass path: when trace data contained all required columns, the test body never executed. Rewritten to always truncatecols_presentso the ValueError assertion always fires.Coverage additions (test_coverage_gaps.py):
test_simplify_name_truncates_long_names— covers truncation path in_simplify_nametest_plot_gpu_kernels_delegates— coversplot_timeline_gpu_kernels(previously 0% coverage)test_plot_gpu_kernels_from_trace— coversplot_timeline_gpu_kernels_from_trace(previously 0% coverage)Reviewed By: Chenguang-Zhu
Differential Revision: D104891668