[Core] TestAvroPartitionStatsHandler fails on Windows due to unclosed partition statistics scan

Đang mở Phù hợp với người mới
#18,938 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

@Ankitkj1999 đang làm issue này rồi.

Từ ngày 14/11/2026.

  • #18939 của @Ankitkj1999 — đang mở

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
82/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ệ
java
Lĩnh vực
testing

Hướng nghiên cứu

Bắt đầu từ PartitionStatsHandlerTestBase.testCopyOnWriteDelete(), phương thức này gọi testTable.newPartitionStatisticsScan().scan() hai lần mà không đóng CloseableIterable được trả về. Hãy theo mẫu try-with-resources được dùng trong cùng lớp cơ sở, gần các lệnh gọi scan khác. Hoàn thành khi cả hai scan đều được đóng và TestAvroPartitionStatsHandler dọn dẹp thư mục tạm của nó trên Windows mà không gây IOException.

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

Mô tả

Apache Iceberg version

main (development)

Query engine

None

Please describe the bug 🐞

PartitionStatsHandlerTestBase.testCopyOnWriteDelete() performs two calls to testTable.newPartitionStatisticsScan().scan() without closing the resulting CloseableIterable.

Because the underlying Avro reader file descriptor remains open, on Windows the operating system locks the temporary metadata statistics files (partition-stats-1-....avro and partition-stats-3-....avro). When JUnit 5's @TempDir extension attempts to clean up the temporary directory during test teardown, it fails with:

\
TestAvroPartitionStatsHandler > testCopyOnWriteDelete() FAILED
java.io.IOException: Failed to delete temp directory C:\Users...\AppData\Local\Temp\junit-...\metadata\partition-stats-1-...avro
\\

Closing both scans in try-with-resources (consistent with other test methods in PartitionStatsHandlerTestBase such as lines 209, 287, and 444) releases the open file handles and resolves the failure.

Ngôn ngữ chính
Java
Star
9.4k
Fork
3.7k
Merge trung bình
2 ngày 16 giờ
Pull request đã merge (30 ngày)
160

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 apache/iceberg

Tất cả issue của apache/iceberg

Issue tương tự

Thêm issue về Java

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.