Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Testing the existence of a directory is very slow

Đang mở
#326 0 bình luận 2 reaction 0 người được giao Xem trên GitHub

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
go
Lĩnh vực
cli, performance

Hướng nghiên cứu

Tái hiện báo cáo với container-structure.yaml được hiển thị, image nginx và kiểm tra fileExistenceTests cho /, bằng lệnh và ghi log debug từ issue. Truy vết điểm vào của bài kiểm tra sự tồn tại của tệp và xác định xem việc kiểm tra một thư mục có duyệt qua nội dung lồng nhau hay không. Được xem là hoàn tất khi đã hiểu hành vi, kiểm tra sự tồn tại hoàn tất mà không có độ trễ không cần thiết được báo cáo, và trường hợp này có coverage.

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

Mô tả

When testing the existence of a directory it appears that if the directory contains many (nested) files, the test takes a considerable amount of time to complete. Is this expected? My assumption is that this test would complete quite quickly. For example, the following test takes 9 seconds to complete on my arm64 macOS 12.6.1 system against the community nginx image:

Test:

fileExistenceTests:
  - name: Root
    path: /
    shouldExist: true

Output (w/ time):

$ time container-structure-test -v debug test --image nginx --config container-structure.yaml
INFO[0000] container-structure-test &{Version:1.14.0 GitVersion: BuildDate:2022-11-22T13:04:18Z GoVersion:go1.19.3 Compiler:gc Platform:darwin/arm64}

=================================================
====== Test file: container-structure.yaml ======
=================================================
INFO[0000] File Existence Test: Root
DEBU[0009] Skipping empty metadata test
=== RUN: File Existence Test: Work dir exists
--- PASS
duration: 0s

=================================================
==================== RESULTS ====================
=================================================
Passes:      1
Failures:    0
Duration:    0s
Total tests: 1

PASS
container-structure-test -v debug test --image nginx --config   0.16s user 0.62s system 7% cpu 9.943 total
Ngôn ngữ chính
Go
Star
2.5k
Fork
213
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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

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 GoogleContainerTools/container-structure-test

Tất cả issue của GoogleContainerTools/container-structure-test

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.