TestPoolOfLiarsFallsBackToTrusted fails under full-suite load

Đang mở Phù hợp với người mới
#412 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
testing

Hướng nghiên cứu

Bắt đầu tại internal/scan/retry_edges_test.go:154-168 và đọc TestPoolOfLiarsFallsBackToTrusted; issue xác định thời gian chờ của resolver quá ngắn và số lượng kết quả chính xác là nguyên nhân gây lỗi chập chờn. Chạy go test ./internal/scan/ -run TestPoolOfLiarsFallsBackToTrusted -count=20. Điều chỉnh bài kiểm thử để chấp nhận một phản hồi loopback chậm và mở rộng thông báo lỗi để báo cáo kết quả của các tên bị thiếu; xác nhận bài kiểm thử mục tiêu chạy thành công.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Go
Star
1
Fork
1
Merge trung bình
7 giờ 18 phút
Pull request đã merge (30 ngày)
23

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TMHSDigital/subenum

Tất cả issue của TMHSDigital/subenum

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.