Skip to content

[Bug]: JSON_OVERLAPS allocation regression test is flaky under -race #26243

Closed

Description

@jiangxinmeng1

Branch

main (the test was introduced by #25981).

Summary

TestJSONOverlapsAccessorAllocationsDoNotScaleWithRows uses testing.AllocsPerRun to assert that accessor allocations do not scale with row count. Exact allocation counts are not stable under race instrumentation and can be contaminated by race/runtime background allocations, causing a false-positive UT failure even though the JSON_OVERLAPS behavior is correct.

Failure

In GitHub Actions job https://github.com/matrixorigin/matrixone/actions/runs/30250968231/job/89928794323 the race UT reported:

TestJSONOverlapsAccessorAllocationsDoNotScaleWithRows
"29" is not less than or equal to "10"
accessor allocations must be batch-scoped: one=0.000000 many=29.000000

The coverage UT in the same workflow passed.

Reproduction / evidence

The same deterministic CGo race command was run against both the PR merge commit and its clean base:

PR merge 827a97406: 5/5 passed
base     58299628c: 5/5 passed

This confirms the failure is intermittent rather than caused by the parser changes in #26236.

Expected behavior

Allocation-count regression assertions should remain active in ordinary and coverage UTs, while race UTs should continue to cover JSON_OVERLAPS functional behavior without relying on unstable exact allocation counts.

Proposed fix

Move the allocation-only test into a //go:build !race test file, following the existing pattern in func_json_merge_alloc_test.go. Keep all JSON_OVERLAPS functional tests enabled in both normal and race builds.

Related PR: #26236

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

Metadata

Metadata

Assignees

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