You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "jason810496 (via GitHub)" <gi...@apache.org> on 2026/05/27 11:37:02 UTC

[PR] Go-SDK: exclude oversized-payload framing test from -race builds [airflow]

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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Go-SDK: exclude oversized-payload framing test from -race builds [airflow]

Posted by "jason810496 (via GitHub)" <gi...@apache.org>.
jason810496 commented on code in PR #67602:
URL: https://github.com/apache/airflow/pull/67602#discussion_r3314973346


##########
go-sdk/pkg/execution/frames_oversized_test.go:
##########
@@ -0,0 +1,63 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+//go:build !race

Review Comment:
   Having `//go:build !race` in a separated module it the key point of the fix. 



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Go-SDK: exclude oversized-payload framing test from -race builds [airflow]

Posted by "jason810496 (via GitHub)" <gi...@apache.org>.
jason810496 merged PR #67602:
URL: https://github.com/apache/airflow/pull/67602


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org