diff --git a/pkg/formatter/expression_scaling_test.go b/pkg/formatter/expression_scaling_test.go index 29d7630b..4e3f115c 100644 --- a/pkg/formatter/expression_scaling_test.go +++ b/pkg/formatter/expression_scaling_test.go @@ -30,6 +30,11 @@ import ( // and the 64x bound leaves room for noisy shared CI runners. Build ASTs outside the measurement so // parser limits and parsing time do not conceal formatter regressions. func TestFormatASTExpressionLinearGrowth(t *testing.T) { + // Race instrumentation inflates allocation-heavy paths unevenly across + // input sizes, so the growth ratio is only meaningful without it. + if raceEnabled { + t.Skip("timing ratios are unreliable under the race detector") + } for _, shape := range []struct { name string small int diff --git a/pkg/formatter/race_enabled_norace_test.go b/pkg/formatter/race_enabled_norace_test.go new file mode 100644 index 00000000..5b3cc4b4 --- /dev/null +++ b/pkg/formatter/race_enabled_norace_test.go @@ -0,0 +1,20 @@ +// Copyright 2026 GoSQLX Authors +// +// Licensed 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 + +package formatter_test + +// raceEnabled reports whether the race detector instruments this test binary. +const raceEnabled = false diff --git a/pkg/formatter/race_enabled_race_test.go b/pkg/formatter/race_enabled_race_test.go new file mode 100644 index 00000000..bd5e53e1 --- /dev/null +++ b/pkg/formatter/race_enabled_race_test.go @@ -0,0 +1,20 @@ +// Copyright 2026 GoSQLX Authors +// +// Licensed 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 + +package formatter_test + +// raceEnabled reports whether the race detector instruments this test binary. +const raceEnabled = true