Commit 5479de1
Fix flaky buck2 core golden tests by stripping spurious glog lines
Summary:
Three buck2 core tests were intermittently failing because C++ libraries linked into the buck2 binary (and the tools it spawns) emit a glog-format INFO line to stderr during process init, e.g. `I0623 15:40:41.926481 128942 Hash.cpp:327] tiHash seed: 12824087ull` (from `ti/common/utils/Hash.cpp`). Whether and when these lines appear in captured stderr varies between runs, so they leak non-deterministically into the output that golden tests compare against:
- `test_errors.py::test_package_listing_errors`
- `test_formatting.py::test_bxl_with_stacktrace`
- `test_error_categorization.py::test_init_data_timeout`
The line uses the standard glog prefix (`[WIEF]MMDD HH:MM:SS.dddddd`), which is distinct from buck2's own tracing-subscriber `[<TIMESTAMP>]` format, so it can be filtered safely. This adds a shared `strip_glog_lines` helper to `golden.py` that drops whole lines carrying the glog marker while preserving all other newlines (so callers' trailing/blank-line structure is unchanged), and applies it in the central `sanitize_stderr` plus the two tests that use custom sanitizers. The existing copy-pasted glog filter in `test_oom_detection.py` is consolidated onto the shared helper.
The marker is matched anywhere in the line so indented occurrences (e.g. when nested inside an embedded daemon stderr block, as in `test_init_data_timeout`) are also stripped.
___
Differential Revision: D109498020
fbshipit-source-id: 463221a583984f1fdf3ef40e234c889de325bc851 parent 5f01c59 commit 5479de1
3 files changed
Lines changed: 25 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
76 | 79 | | |
77 | 80 | | |
78 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
172 | 189 | | |
| 190 | + | |
173 | 191 | | |
174 | 192 | | |
175 | 193 | | |
| |||
0 commit comments