--- id: "bug-1542" status: "fixed" status_updated: "2026-09-24" status_note: "" component: "apiserver" severity: "unknown" timestamp: "2026-08-12T10:18:42.192Z" last_seen: "2026-09-19T09:00:00Z" occurrences: 1 files: ["src/frontend/apiserver/backend/health_rejoin_test.go"] tags: ["go", "cgo", "test-file-restriction", "import-C-in-test"] related: [] legacy: true --- # bug-1542: health_rejoin_test.go referenced C.E_XCE_NOT_READY directly (via -int(C.E_XCE_NOT_READY)), which… ## Description health_rejoin_test.go referenced C.E_XCE_NOT_READY directly (via -int(C.E_XCE_NOT_READY)), which requires import "C" in a _test.go file -- illegal per golang/go#13938, would have failed to compile ## Environment _Not recorded (migrated from buglog.json)._ ## Reproduction _Not recorded (migrated from buglog.json)._ ## Root cause Wrote a test helper that needed the -E_XCE_NOT_READY errno value, and reached for C.E_XCE_NOT_READY directly without recalling that _test.go files can never import "C" themselves (established project constraint, see clib_test.go/reconnect_test.go doc comments) -- caught before ever running go test, by re-reading the file before the first test run. ## Fix Exposed -E_XCE_NOT_READY as a plain Go int via a new package-level var in clib.go (a cgo file): notReadyRC = -int(C.E_XCE_NOT_READY). health_rejoin_test.go references notReadyRC instead of C.E_XCE_NOT_READY -- same plain-Go-signature test-seam pattern as performRejoinFn (reconnect.go, task 4.3). ## Verification _Not recorded (migrated from buglog.json)._ ## References _Not recorded (migrated from buglog.json)._