jason810496 opened a new pull request, #67602:
URL: https://github.com/apache/airflow/pull/67602

   ## Why
   
   `go test -race ./pkg/execution/` currently fatals before any test in the 
package can run. 
   
   `TestWriteFrameRejectsOversizedPayload` constructs a 4 GiB+ slice with 
`unsafe.Slice(&backing, MaxFrameSize+1)` to exercise `writeFrame`'s size guard 
cheaply, and the checkptr instrumentation that `-race` enables treats the 
resulting "slice straddles allocations" as a fatal violation.
   
   The existing `strconv.IntSize` runtime skip does not help, checkptr fires 
inside `unsafe.Slice` itself, before any `t.Skip` could run.
   
   ## What
   
   - Move `TestWriteFrameRejectsOversizedPayload` out of `frames_test.go` into 
a new file `frames_oversized_test.go` carrying `//go:build !race`, so the file 
(and the `unsafe.Slice` call inside it) is excluded from the build under 
`-race`.
   - Drop the now-unused `strconv` and `unsafe` imports from `frames_test.go`.
   
   ## Verification
   
   1. **Non-race build still exercises the test.**
   
      ```
      $ go test -run TestWriteFrameRejectsOversizedPayload -v ./pkg/execution/
      === RUN   TestWriteFrameRejectsOversizedPayload
      --- PASS: TestWriteFrameRejectsOversizedPayload (0.00s)
      PASS
      ok        github.com/apache/airflow/go-sdk/pkg/execution  0.171s
      ```
   
   2. **Race build skips the test (no checkptr fatal).**
   
      ```
      $ go test -race -run TestWriteFrameRejectsOversizedPayload -v 
./pkg/execution/
      testing: warning: no tests to run
      PASS
      ok        github.com/apache/airflow/go-sdk/pkg/execution  1.235s [no 
tests to run]
      ```
   
   3. **Whole package now passes under `-race`** (previously fatal):
   
      ```
      $ go test -race ./pkg/execution/
      ok        github.com/apache/airflow/go-sdk/pkg/execution  1.823s
      ```
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes, with help of Claude Code Opus 4.7 following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to