Skip to content

ci: gate GitLab gtest jobs on the flaky-test quarantine list - #977

Closed
jbachorik wants to merge 3 commits into
mainfrom
jb/gtest-quarantine-wiring
Closed

jbachorik wants to merge 3 commits into
mainfrom
jb/gtest-quarantine-wiring

Conversation

@jbachorik

Copy link
Copy Markdown
Collaborator

What does this PR do?:
Wires the GitLab gtest jobs (gtest-{release,asan,tsan}-{amd64,arm64} in .gitlab/sanitizer-tests/.gitlab-ci.yml) into the flaky-test quarantine mechanism that the GitHub Actions Java jobs already use. Each gtest binary now runs with --gtest_output=xml: and a gate (gtest_quarantine_gate.py) applies ddprof-test/quarantine.txt to the results: a quarantined failure keeps reporting but does not fail the job; an un-quarantined failure, or a binary that exited non-zero without naming a test, fails it.

Motivation:
PROF-16577: NativeThreadNameRaceTest.threadDyingBetweenScansIsNeverNamed fails ~daily on quiet gtest runners, and the gtest jobs had no quarantine escape hatch — the only lever was deleting the test or GTEST_SKIP() (shipped as an interim on PR #898). This closes the gap so C++ flakes are handled like Java flakes: tracked, ticketed, still reporting, not gating.

Additional Notes:

  • The gate reuses quarantine.find_entry() directly (single source of matching truth); it mirrors flake_report.py's verdict philosophy in a single-attempt shape: un-quarantined named failure → gate; all named failures quarantined → excused; non-zero exit with no named failure (crash, unreadable report) → gate, fail-closed.
  • The XML reports are only needed to excuse, never to pass: a failing test makes gtest exit non-zero on its own, so a broken report degrades to rc-based gating rather than silent green.
  • Cell naming: glibc-gtest-<config>-<arch> — the gtest binaries run under no target JDK, so the jdk slot names the runner kind; arch uses aarch64/amd64 per quarantine.py's KNOWN_ARCHES.
  • Behavior change in the runner loop: a failing binary no longer stops the remaining suites (they all run and report; the gate owns the verdict). The per-binary === name === headers, FAILED: <name> exited N lines, artifact paths, TSan GTEST_DEATH_TEST_STYLE and the arm64 sysctl are unchanged.
  • New quarantine entry for the PROF-16577 flake, scoped to glibc-gtest-*-amd64 (the only cells it has failed on); review_by 2027-02-09.
  • This PR does NOT revert PR Reference-chain cache: rebuild stale chains (improved path, correlation) instead of erasing them #898's interim GTEST_SKIP(): the revert lands after Reference-chain cache: rebuild stale chains (improved path, correlation) instead of erasing them #898 merges (the skip does not exist on main yet, so there is nothing to revert here).

How to test the change?:

  • .github/scripts/tests/test_gtest_quarantine_gate.sh: 16 hermetic cases (gate verdicts, <error> parsing, rc-decides contract, dedup, empty-list refusal, and full-runner smokes via a stub binary: rc propagation, quarantine excuse, crash-without-report gating, non-executable-subset refusal).
  • quarantine.py validate, shellcheck run-gtests.sh, bash -n, copyright/CLAUDE.md/knowledgebase checks: all pass.
  • First live validation is the GitLab pipeline on this branch; the quarantine entry keeps NativeThreadNameRaceTest failures from gating gtest-release-amd64/gtest-tsan-amd64.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a security review (run the dd:platform-security-review
    skill, or file a request via the PSEC review form).
    bewaire also runs automatically on every PR.
  • This PR doesn't touch any of that.
  • JIRA: PROF-16577

@jbachorik jbachorik added the AI label Nov 11, 2026
@dd-octo-sts

dd-octo-sts Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Scan-Build Report

User:runner@runnervmwuk1x
Working Directory:/home/runner/work/java-profiler/java-profiler/ddprof-lib/src/test/make
Command Line:make -j4 all
Clang Version:Ubuntu clang version 21.1.8 (6ubuntu1)
Date:Wed Nov 11 09:34:01 2026

Bug Summary

Bug TypeQuantityDisplay?
All Bugs2
Logic error
Dereference of null pointer1
Unused code
Dead initialization1

Filter Results by File

Reports

Bug Group Bug Type ▾ File Function/Method Line Path Length
Unused codeDead initializationreferenceChains.cppapplyOomRamp4971
Logic errorDereference of null pointerperfEvents_linux.cppunregisterThread72026

@jbachorik

Copy link
Copy Markdown
Collaborator Author

Closing as superseded: #974 implements the same wiring (tracking ticket PROF-15902) through the full existing run_tests_with_retry.sh → flake_report.py machinery — retries, flake-vs-broken classification, signal-death and sanitizer-abort handling — with the jdk-less cell naming (glibc-<config>-<arch>) that this PR diverged from. The PROF-16577 quarantine entry for NativeThreadNameRaceTest lives there. Two review findings from this branch that #974 may still want to check against its own runner: capturing $? immediately after the run pipeline (an intervening assignment silently disables the empty-binary-set guard), and refusing to run when a matching gtest binary is non-executable (a skipped suite must not read as a complete passing run).

@jbachorik jbachorik closed this Nov 11, 2026
@dd-octo-sts

dd-octo-sts Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #42996019829 | Commit: 3c15c55 | Duration: 20m 47s (longest job)

✅ All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - ✅ - -
8-ibm - ✅ - -
8-j9 ✅ ✅ - -
8-librca - - ✅ ✅
8-orcl - ✅ - -
11 - ✅ - -
11-j9 ✅ ✅ - -
11-librca - - ✅ ✅
17 ✅ ✅ - -
17-graal ✅ ✅ - -
17-j9 ✅ ✅ - -
17-librca - - ✅ ✅
21 ✅ ✅ - -
21-graal ✅ ✅ - -
21-librca - - ✅ ✅
25 ✅ ✅ - -
25-graal ✅ ✅ - -
25-librca - - ✅ ✅

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-11-11 09:56:30 UTC

@jbachorik
jbachorik deleted the jb/gtest-quarantine-wiring branch November 13, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant