style(tests): переименовать счётчики циклов i в iteration/index
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -158,7 +158,7 @@ func TestRunCmd_SIGTERM_forcesExitAfterTimeout(t *testing.T) {
|
||||
return fake, nil
|
||||
}
|
||||
|
||||
newHealthz = func(port int) (*healthz.Server, error) {
|
||||
newHealthz = func(port int) (healthz.Server, error) {
|
||||
return healthz.New(port)
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ func TestRunCmd_Healthz503DuringShutdown(t *testing.T) {
|
||||
t.Fatalf("failed to create healthz server: %v", err)
|
||||
}
|
||||
|
||||
newHealthz = func(port int) (*healthz.Server, error) {
|
||||
newHealthz = func(port int) (healthz.Server, error) {
|
||||
return srv, nil
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ func TestRunCmd_Healthz503DuringShutdown(t *testing.T) {
|
||||
cancel()
|
||||
|
||||
var status503 bool
|
||||
for i := 0; i < 20; i++ {
|
||||
for iteration := 0; iteration < 20; iteration++ {
|
||||
resp, err = http.Get("http://" + addr + "/healthz")
|
||||
if err == nil {
|
||||
resp.Body.Close()
|
||||
@@ -340,7 +340,7 @@ func TestRunCmd_HealthzBindFailure(t *testing.T) {
|
||||
return fake, nil
|
||||
}
|
||||
|
||||
newHealthz = func(port int) (*healthz.Server, error) {
|
||||
newHealthz = func(port int) (healthz.Server, error) {
|
||||
return nil, errors.New("bind failed")
|
||||
}
|
||||
|
||||
|
||||
@@ -114,24 +114,24 @@ func TestRoundTrip(t *testing.T) {
|
||||
func TestRoundTripMany(t *testing.T) {
|
||||
adapter := New()
|
||||
|
||||
for i := 0; i < 1000; i++ {
|
||||
for iteration := 0; iteration < 1000; iteration++ {
|
||||
pub, priv, err := adapter.GenerateKeyPair(rand.Reader)
|
||||
if err != nil {
|
||||
t.Fatalf("iteration %d: GenerateKeyPair failed: %v", i, err)
|
||||
t.Fatalf("iteration %d: GenerateKeyPair failed: %v", iteration, err)
|
||||
}
|
||||
|
||||
ct, ssEnc, err := adapter.Encapsulate(pub, rand.Reader)
|
||||
if err != nil {
|
||||
t.Fatalf("iteration %d: Encapsulate failed: %v", i, err)
|
||||
t.Fatalf("iteration %d: Encapsulate failed: %v", iteration, err)
|
||||
}
|
||||
|
||||
ssDec, err := adapter.Decapsulate(priv, ct)
|
||||
if err != nil {
|
||||
t.Fatalf("iteration %d: Decapsulate failed: %v", i, err)
|
||||
t.Fatalf("iteration %d: Decapsulate failed: %v", iteration, err)
|
||||
}
|
||||
|
||||
if !bytes.Equal(ssEnc, ssDec) {
|
||||
t.Fatalf("iteration %d: shared secret mismatch", i)
|
||||
t.Fatalf("iteration %d: shared secret mismatch", iteration)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user