Skip to content

harness-jira-test.sh flakes: yq | grep -q SIGPIPE race under pipefail #1165

Description

@waynesun09

What happened

make test fails intermittently in scripts/harness-jira-test.sh (2–4 of the same four assertions per run, a different set each time): triage-jira-token-in-runner, triage-jira-email-in-sandbox, triage-jira-base-url-in-sandbox, code-jira-email-in-sandbox. The harness files are correct; the test is racy.

Cause

The script runs under set -euo pipefail and those assertions are jira_overlay_field … | grep -qF KEY. grep -q exits on the first match while yq is still writing the rest of its multi-line output, so yq takes SIGPIPE (rc 141) and pipefail turns the assertion false. Instrumented: rc=141 pipestatus=[0] on 6 of 8 runs of the JIRA_TOKEN check. Only positive multi-line greps flake; the negative *-not-in-sandbox checks read to EOF and never do.

Fix

Capture the field first, then match (out="$(jira_overlay_field …)"; grep -qF KEY <<<"$out"). PR #1164.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pr-openAn open PR already addresses this issue

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions