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

Aperta Adatta ai principianti
#18,938 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Ankitkj1999 ci sta già lavorando.

Dal 14/11/2026.

  • #18939 di @Ankitkj1999 — aperta

Valutazione

Difficoltà
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
82/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
testing

Direzione di ricerca

Inizia da PartitionStatsHandlerTestBase.testCopyOnWriteDelete(), che chiama due volte testTable.newPartitionStatisticsScan().scan() senza chiudere il CloseableIterable restituito. Segui il pattern try-with-resources usato nella stessa classe base vicino alle altre chiamate di scan. È completato quando entrambi gli scan sono chiusi e TestAvroPartitionStatsHandler pulisce la sua directory temporanea su Windows senza la IOException.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
Java
Stelle
9.4k
Fork
3.7k
Merge medio
2g 16h
PR unite (30g)
160

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/iceberg

Tutte le issue di apache/iceberg

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.