Skip to content

test: Actions GetWorkflowRun tests contain structurally invalid JSON payloads #4196

@merchantmoh-debug

Description

@merchantmoh-debug

While developing a performance optimization PR that introduces strict json.Unmarshal decoding, the CI runner surfaced a latent bug in the go-github test suite.

In actions_workflow_runs_test.go, the mock HTTP server endpoints for TestActionsService_GetWorkflowRunAttempt and TestActionsService_GetWorkflowRunByID are returning structurally invalid JSON payloads with double closing braces (}}).

The current Client.Do implementation uses json.NewDecoder(resp.Body).Decode(), which is a lazy streaming parser. It reads until the first valid } and silently ignores the trailing garbage byte. Any future PR that moves the client toward stricter, high-throughput parsing (like json.Unmarshal) will instantly fail these tests.

I have isolated this bug and will open an atomic PR to fix it so it doesn't block future optimizations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions