test: isolate console fixtures from VCS and stack dump limits
Disable VCS stamping for the throwaway ELF fixture while retaining its architecture and embedded build-stamp checks. A pre-existing empty .git above the shared temp directory otherwise prevents the fixture from building. Grow the SQL seal tests' goroutine dump buffer until it is complete. A full package run can exceed the old one-MiB limit and omit the goroutine whose mutex wait the test must observe. Start small so isolated tests exercise growth too; keep the existing deadlines and all refusal assertions. Verified the original seal witness fails under a ten-thousand-goroutine overlay and both fixed witnesses pass under the same load, plus the race gate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+18
−7
internal/console/controlplane_test.go+1 −1internal/console/plan9_sql_seal_test.go+17 −6
CI passed — run details
Intent
Attributed to this commit: 15.4 g CO₂e (1,897,498 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on stateless-replicas-1-runtime, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/internal/console/controlplane_test.go b/internal/console/controlplane_test.go| index 08cf6b77e..d7ebc1b16 100644 |
| --- a/internal/console/controlplane_test.go |
| +++ b/internal/console/controlplane_test.go |
| @@ -638,7 +638,7 @@ func buildTestELF(t *testing.T, goos, goarch, build string) []byte { |
| if build != "" { |
| ldflags += " -X github.com/carlosframework/platform/internal/version.Build=" + build |
| } |
| - cmd := exec.Command("go", "build", "-ldflags", ldflags, "-o", out, ".") |
| + cmd := exec.Command("go", "build", "-buildvcs=false", "-ldflags", ldflags, "-o", out, ".") |
| cmd.Dir = dir |
| // GOWORK=off and CGO_ENABLED=0 so the build does not depend on this |
| // checkout's module graph or on a C toolchain for the host arch. |
diff --git a/internal/console/plan9_sql_seal_test.go b/internal/console/plan9_sql_seal_test.go| index fd8500935..99a4f649b 100644 |
| --- a/internal/console/plan9_sql_seal_test.go |
| +++ b/internal/console/plan9_sql_seal_test.go |
| @@ -46,19 +46,30 @@ func plan9SealQueuedStmtQuery(st *sql.Stmt, out chan<- error) { |
| out <- err |
| } |
| +func plan9SealStacks(buf []byte) []byte { |
| + buf = buf[:cap(buf)] |
| + for { |
| + n := runtime.Stack(buf, true) |
| + if n < len(buf) { |
| + return buf[:n] |
| + } |
| + buf = make([]byte, len(buf)*2) |
| + } |
| +} |
| + |
| // waitPlan9SealQueued returns once the goroutine running fn has finished |
| // (done has a value) or is parked on the database/sql driver-connection lock, |
| // which the batch commit holds. |
| func waitPlan9SealQueued(t *testing.T, fn string, done chan error) { |
| t.Helper() |
| deadline := time.Now().Add(10 * time.Second) |
| - buf := make([]byte, 1<<20) |
| + buf := make([]byte, 128) |
| for time.Now().Before(deadline) { |
| if len(done) > 0 { |
| return |
| } |
| - n := runtime.Stack(buf, true) |
| - for _, g := range strings.Split(string(buf[:n]), "\n\n") { |
| + buf = plan9SealStacks(buf) |
| + for _, g := range strings.Split(string(buf), "\n\n") { |
| onDriver := strings.Contains(g, "database/sql.withLock(") || strings.Contains(g, "database/sql.resultFromStatement(") || strings.Contains(g, "database/sql.rowsiFromStatement(") |
| if strings.Contains(g, "console."+fn+"(") && onDriver && strings.Contains(g, "sync.(*Mutex).lockSlow(") { |
| return |
| @@ -248,11 +259,11 @@ func TestPlan9SQLSealDuringHandleRegistration(t *testing.T) { |
| } |
| }() |
| deadline := time.Now().Add(10 * time.Second) |
| - buf := make([]byte, 1<<20) |
| + buf := make([]byte, 128) |
| waiting := false |
| for time.Now().Before(deadline) && !waiting { |
| - n := runtime.Stack(buf, true) |
| - for _, g := range strings.Split(string(buf[:n]), "\n\n") { |
| + buf = plan9SealStacks(buf) |
| + for _, g := range strings.Split(string(buf), "\n\n") { |
| if strings.Contains(g, "console.(*claimBoundDB)."+method+"(") && strings.Contains(g, "sync.(*Mutex).lockSlow(") { |
| waiting = true |
| break |