rustyconover opened a new pull request, #969:
URL: https://github.com/apache/arrow-nanoarrow/pull/969

   `NanoarrowIntegrationTestSchema` and `NanoarrowIntegrationTestBatch` 
(`c_data_integration_test.cc`) write their JSON to the same file, 
`c_data_integration.tmp.json`, in the working directory. 
`gtest_discover_tests()` registers each gtest case as a separate ctest test, so 
`ctest -j` runs the two as parallel processes. One can then overwrite or remove 
the other's file. When that happens the Batch test reads the Schema test's JSON 
and fails with:
   
   ```
   Expected num_batch between 0 and -1 but got 1
   ```
   
   In a full `ctest -j 12` run it fails now and then. I hit it on three 
unrelated branches in one day. With only these two tests running they start 
together, and on `main` `ctest -R NanoarrowIntegrationTest -j 2` failed 199 of 
200 runs. Run serially, both pass.
   
   With this PR, `TempFile` includes the current test's name 
(`c_data_integration.<test name>.tmp.json`), so each test gets its own file. 
It's still written to the working directory, as before, which the existing 
comment keeps for portability. After the change the same loop failed 0 of 200 
runs, and no temp files are left behind. Full ctest passes (macOS arm64, Debug, 
388 tests, three runs).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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