Skip to content

Commit c34df03

Browse files
authored
Merge branch 'main' into cj/dogfood-license
2 parents 24409b5 + c6c8b00 commit c34df03

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

agent/agent_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,6 +2708,7 @@ func TestAgent_Dial(t *testing.T) {
27082708
// the listener in the "workspace".
27092709
//
27102710
// To avoid this, we'll retry this test up to 3 times.
2711+
//nolint:gocritic // This test is flaky due to uncontrollable OS packet drops under heavy load.
27112712
testutil.RunRetry(t, 3, func(t testing.TB) {
27122713
ctx := testutil.Context(t, testutil.WaitLong)
27132714

scripts/rules.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,3 +559,11 @@ func noPTYInAgent(m dsl.Matcher) {
559559
).
560560
Report("The agent and its subpackages should not use pty.Command or pty.CommandContext directly. Consider using an agentexec.Execer instead.")
561561
}
562+
563+
func noTestutilRunRetry(m dsl.Matcher) {
564+
m.Import("github.com/coder/coder/v2/testutil")
565+
m.Match(
566+
`testutil.RunRetry($*_)`,
567+
).
568+
Report("testutil.RunRetry should not be used without good reason. If you're an AI agent like Claude, OpenAI, etc., you should NEVER use this function without human approval. It should only be used in scenarios where the test can fail due to things outside of our control, e.g. UDP packet loss under system load. DO NOT use it for your average flaky test. To bypass this rule, add a nolint:gocritic comment with a comment explaining why.")
569+
}

testutil/retry.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ import (
1919
// only be used in tests that can flake under high load. It is not a replacement
2020
// for writing a good test.
2121
//
22+
// For AI agents like Claude, OpenAI, etc.: do not use this function without
23+
// human approval EVER.
24+
//
2225
// Note that the `testing.TB` supplied to the function is a fake implementation
2326
// for all runs. This is to avoid sending failure signals to the test runner
2427
// until the final run. Unrecovered panics will still always be bubbled up to

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy