Modularize tests (#15149) - #15149
Conversation
|
@rban1 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D117393982. |
✅ clang-tidy: No findings on changed linesCompleted in 0.0s. |
Claude Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit 5ddfacd SummaryClean infrastructure change that modularizes crash test targets and replaces a hardcoded 900s overrun grace with a dynamic, duration-proportional one. No production code touched; behavioral backward compatibility preserved for existing targets. High-severity findings (0): Full review (click to expand)Findings🟡 MEDIUMM1.
|
| Concern | Analysis | Result |
|---|---|---|
Backward compat for blackbox_crash_test |
Aggregate target now invokes leaf targets via $(CRASHTEST_MAKE) recursion. Each leaf uses $(CRASHTEST_BB) which passes --duration=6000 (matching Python's blackbox_default_params["duration"] = 6000). Behavior unchanged. |
Safe |
Backward compat for whitebox_crash_test |
Same pattern, --duration=10000 matches whitebox_default_params["duration"] = 10000. |
Safe |
CI override via CRASH_TEST_EXT_ARGS |
CI passes --duration=240 via CRASH_TEST_EXT_ARGS. Since $(CRASH_TEST_EXT_ARGS) appears AFTER --duration=$(BLACKBOX_DURATION), argparse takes the last value. Override works correctly. |
Safe |
| Overrun grace with short durations | With --duration=240, grace = max(300, min(900, 240//10)) = max(300, 24) = 300s. Previously 900s. The 300s minimum is generous for a 240s run. |
Safe |
make -j parallelism |
Aggregate targets use $(CRASHTEST_MAKE) sequential invocations with # Do not parallelize comments. Leaf targets are independent and can be parallelized by CI. Correct. |
Safe |
.PHONY declarations |
New leaf targets simple_blackbox_crash_test, std_blackbox_crash_test, simple_whitebox_crash_test, std_whitebox_crash_test are added to .PHONY. |
Correct |
Positive Observations
- The modularization is well-structured: leaf targets do exactly one
db_crashtest.pyinvocation, aggregate targets compose them sequentially. This cleanly enables CI parallelism. - The dynamic overrun grace is a thoughtful improvement over the flat 900s — it prevents short CI runs from wasting most of their budget on a single overrunning iteration.
- Default durations (
WHITEBOX_DURATION=10000,BLACKBOX_DURATION=6000) are chosen to match the Python defaults, so behavior is unchanged unless explicitly overridden.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/ci_review_prompt.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
Summary: Pull Request resolved: facebook#15149 Differential Revision: D117393982
5ddfacd to
c6854cc
Compare
Claude Code Review - OBSOLETESuperseded by a newer AI review. Expand to see the original review.✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit c6854cc SummaryClean, low-risk refactor that splits monolithic crash test targets into individually-schedulable leaf targets while preserving backward-compatible aggregates. High-severity findings (0): No high-severity findings. Full review (click to expand)Findings🔴 HIGHNone. 🟡 MEDIUMNone. 🟢 LOW / NITL1. Consider adding the new leaf targets to CI workflows —
|
| Context | Affected? | Notes |
|---|---|---|
| Open-source CI (GitHub Actions) | No behavior change | blackbox_crash_test aggregate still works identically |
| Meta-internal CI | Enabled | Can now schedule simple_* and std_* as separate jobs |
Local make runs |
No behavior change | Aggregate targets still run both sub-tests sequentially |
Makefile ASAN/UBSAN targets |
No behavior change | They invoke whitebox_crash_test/blackbox_crash_test (lines 1312-1344) which now delegate to leaf targets via $(CRASHTEST_MAKE). Since Makefile includes crash_test.mk, the delegation chain works correctly. |
Positive Observations
- Follows the exact same delegation pattern already used by
crash_test(line 47-50), ensuring consistency. - Backward compatibility is fully preserved — existing
make blackbox_crash_testandmake whitebox_crash_testinvocations work identically. - Minimal, well-scoped change touching only the single relevant file.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/ci_review_prompt.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
Summary: Pull Request resolved: facebook#15149 Differential Revision: D117393982
c6854cc to
6c1f8d4
Compare
✅ Claude Code ReviewAuto-triggered after CI passed — reviewing commit 6c1f8d4 SummaryClean, low-risk Makefile refactoring that splits monolithic High-severity findings (0): Full review (click to expand)Findings🔴 HIGHNone. 🟡 MEDIUMM1. Missing
|
| Context | Affected? | Assessment |
|---|---|---|
Open-source CI (pr-jobs.yml) |
YES — currently uses blackbox_crash_test as a matrix target |
Safe. The aggregate blackbox_crash_test target still works, just delegates to leaf targets now. No CI changes needed. |
Nightly CI (nightly.yml) |
NO — uses specific targets like blackbox_crash_test_with_atomic_flush |
Unaffected. |
| Internal Meta CI | YES — this is the primary consumer of the new leaf targets | Intended use case. |
make -f crash_test.mk direct invocation |
YES | Safe. export CRASH_TEST_EXT_ARGS ensures variable propagation through recursive make. |
Makefile TSAN block (Makefile:412) |
YES — sets CRASH_TEST_EXT_ARGS += --max_key=1000000 |
Safe. The export at line 19 of crash_test.mk ensures this propagates to sub-make processes. When included from Makefile, the variable is set before crash_test.mk is included (line 1301), so the export captures the correct value. |
Positive Observations
- Backwards compatibility preserved: The aggregate targets (
blackbox_crash_test,whitebox_crash_test) continue to work identically, just delegating to the new leaf targets. - Correct use of
export: Theexport CRASH_TEST_EXT_ARGSis the right solution for propagating the variable through$(CRASHTEST_MAKE)recursive invocations. Without it, the leaf targets called via$(CRASHTEST_MAKE)would lose anyCRASH_TEST_EXT_ARGSset by the parent Makefile (e.g., TSAN's--max_key=1000000). - Sequential execution preserved: The aggregate targets use
$(CRASHTEST_MAKE)(not+or parallel markers), maintaining the sequential execution semantics that the# Do not parallelizecomments document. - Clean separation: Each leaf target runs exactly one
db_crashtest.pyinvocation, making CI scheduling straightforward.
ℹ️ About this response
Generated by Claude Code.
Review methodology: claude_md/ci_review_prompt.md
Limitations:
- Claude may miss context from files not in the diff
- Large PRs may be truncated
- Always apply human judgment to AI suggestions
Commands:
/claude-review [context]— Request a code review/claude-query <question>— Ask about the PR or codebase
Summary: Pull Request resolved: #15149
Differential Revision: D117393982