[test-parallel] test: parallelize safe Go test (daily batch) - #55047
[test-parallel] test: parallelize safe Go test (daily batch)#55047github-actions[bot] wants to merge 4 commits into
Conversation
|
👋 Thanks for opening this PR! However, this appears to be a work-in-progress pre-created by an automated GitHub Actions workflow for the Daily Go Test Parallelizer rather than a traditional external contribution. Since this is an internal agentic workflow PR created by the core team automation, it falls outside the scope of the contributing guidelines for external contributors. The guidelines explicitly state:
If you are a core team member working on this internal workflow, please disregard this evaluation - the PR will be assessed once the agent completes its work and actual changes are present. If you are an external contributor, please create a detailed agentic plan in an issue instead of a direct PR.
|
Analyzed 25 test files in pkg/cli/ (compile_guard_policy_test.go through compile_watch_environment_test.go) for safe t.Parallel() additions. Only one test was demonstrably safe to parallelize; the rest use process-global state (os.Chdir via setupIntegrationTest, os.Stdout/os.Stderr redirection, shared package-level vars) that would race under -race if parallelized. TestCompileUpdateDiscussionFieldEnforcement uses only t.TempDir() and local variables, with no shared/global state, making it safe. Verified with 'go test -race' targeting the modified test.
…atch) Analyzed 25 test files (compile_wif_anthropic_integration_test.go through docker_build_integration_test.go) for safe t.Parallel() additions. Safe additions made to: - copilot_setup_runs_on_test.go: TestValidateCopilotSetupStepsRunsOn (pure function, no shared state) - daily_regression_audit_workflow_contract_test.go: TestDailyRegressionAuditAllowsPythonJSONParsing (read-only file checks) - deps_test.go: 8 top-level tests + table-driven subtests (pure helpers, isolated temp files) - docker_args_validation_test.go: 6 top-level tests + table-driven subtests (pure validation functions, isolated temp dirs) - docker_build_integration_test.go: TestIsTransientDockerBuildFailure, TestDockerfile_Exists, TestMakefile_DockerTargets (read-only file/pure checks; Docker build/run tests left unparallelized due to shared image tag and external Docker daemon dependency) Skipped as unsafe: files using os.Chdir, t.Setenv, package-level global reassignment, or unverified shared setup helpers (compile_wif_*_integration_test.go, completions_integration_test.go, completions_test.go, context_cancellation_test.go, copilot_agents_test.go, copilot_billing_check_test.go, copilot_setup_test.go, dependency_graph_test.go, deploy_command_test.go, deploy_org_test.go, devcontainer_test.go). Verified with 'go test -race' targeting all modified tests plus a full 'go test ./pkg/cli/...' run (one pre-existing unrelated network-dependent test failure confirmed present on the pre-change baseline too). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Daily Go Test Parallelizer
Analyzed a batch of 25
pkg/cli/*_test.gofiles (round-robin resuming aftercompile_guard_policy_policy_report_test.go, ending atcompile_watch_environment_test.go).Result: 1 safe change
TestCompileUpdateDiscussionFieldEnforcement(pkg/cli/compile_update_discussion_test.go): addedt.Parallel(). This test only usest.TempDir()and local variables — no shared/global state, noos.Chdir, noos.Setenv, no shared mutable globals.Why the other 24 files were left unchanged
setupIntegrationTest(e.g.compile_permissions_integration_test.go,compile_pull_request_target_integration_test.go,compile_safe_update_integration_test.go,compile_service_ports_integration_test.go,compile_safe_outputs_needs_imports_integration_test.go,compile_max_turns_import_integration_test.go,compile_model_fallback_integration_test.go) rely onos.Chdirto a process-wide working directory — unsafe to parallelize.os.Stdout/os.Stderrfor output capture (e.g.compile_json_output_test.go,compile_stats_test.go,compile_schedule_calendar_test.go,compile_update_check_test.gosubset) — unsafe, since concurrent redirection races.compile_orchestrator_container_pins_test.gomutates a shared package-level function variable (compileUpdateContainerPins); confirmed viago test -racethat addingt.Parallel()there introduces a real data race, so it was reverted.compile_orchestrator_host_test.go,compile_orchestrator_stability_test.go,compile_pipeline_yamllint_test.go,compile_repository_manifest_test.go,compile_update_check_test.go,compile_watch_environment_test.gouset.Setenv/os.Setenv/os.Chdir.compile_pipeline_purge_test.goand most ofcompile_schedule_calendar_test.go/compile_stats_test.goalready havet.Parallel()on all safe candidates.compile_maintenance_test.go,compile_instructions_test.go,compile_integration_test.gouseos.Chdirand/or shared filesystem state — unsafe.Validation
go test -race -run TestCompileUpdateDiscussionFieldEnforcement ./pkg/cli/...— passgo test -run TestCompileUpdateDiscussionFieldEnforcement -v ./pkg/cli/...— passt.Parallel()addition; no other file changes.State cache updated to advance the round-robin cursor to
pkg/cli/compile_watch_environment_test.gofor the next daily run.Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
registry.npmjs.orgTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.