TestPoolOfLiarsFallsBackToTrusted fails under full-suite load

Aberta Para iniciantes
#412 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
85/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
go
Domínio
testing

Direção de pesquisa

Comece em internal/scan/retry_edges_test.go:154-168 e leia TestPoolOfLiarsFallsBackToTrusted; a issue identifica os timeouts apertados do resolver e as contagens exatas de resultados como a origem da instabilidade. Execute go test ./internal/scan/ -run TestPoolOfLiarsFallsBackToTrusted -count=20. Ajuste o teste para tolerar uma resposta lenta de loopback e amplie a mensagem de falha para informar os resultados dos nomes ausentes; confirme que o teste direcionado passa.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

good first issue severity: low testing

Summary

TestPoolOfLiarsFallsBackToTrusted gives both resolvers a 1 s timeout and a single attempt, then asserts exact counts. Under full-suite load, one late loopback answer is enough to fail it.

Where

  • internal/scan/retry_edges_test.go:154-168
  • internal/scan/runner.go:723-743 (resolveViaPool returns the trusted lookup's failure outcome as is)

Details

// Timeout: time.Second, Attempts: 1 on both the lying member and the trusted resolver
if st.Found != 1 || st.NXDomain != int64(len(entries)-1) {

A local full-suite run (go test -count=1 -coverpkg=./... ./...) failed with found 1 nxdomain 19; want only www… after 1.06 s. A passing run takes about 50 ms, so one name used up the whole per-query budget. The failure message prints only Found and NXDomain, so it does not say which outcome the missing name got.

Impact

Occasional red builds on a loaded runner. CI's Linux leg runs this package with -race and -coverpkg, which is slower still. This is the same class as the closed timeout flakes #289 and #235.

Steps to reproduce

Seen once in two local full-suite runs (Windows, go1.26.11). Not reproduced in isolation: go test -count=40 -run 'TestPoolOfLiarsFallsBackToTrusted$' ./internal/scan/ passed every time.

Suggested fix

Give both resolvers headroom: Attempts: 2, or a 3 s timeout on dns.NewResolver, dns.NewPool and Config.Timeout. Add st.Timeout, st.Other and st.Unconfirmed to the failure message.

Acceptance criteria

  • The test tolerates one slow loopback answer
  • The failure message names the outcome of the missing names

Getting started

  • Relevant files: internal/scan/retry_edges_test.go
  • How to run tests: go test ./internal/scan/ -run TestPoolOfLiarsFallsBackToTrusted -count=20
  • Related: #289, #235

Filed by repo-audit/full-audit at dd5b156. Severity: low. Effort: S. audit-key: testing|internal/scan/retry_edges_test.go|TestPoolOfLiarsFallsBackToTrusted

Linguagem predominante
Go
Estrelas
1
Forks
1
Merge médio
7h 18min
PRs com merge (30d)
23

Preparar o ambiente

Abrir no Codespaces

Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TMHSDigital/subenum

Todas as issues de TMHSDigital/subenum

Issues semelhantes

Mais issues de Go

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.