[
https://issues.apache.org/jira/browse/FLINK-40567?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Metzger reassigned FLINK-40567:
--------------------------------------
Assignee: Purushottam Sinha
> HistoryServerArchiveFetcherTest.testLazyFetchArchiveProactively is flaky on
> @TempDir cleanup
> --------------------------------------------------------------------------------------------
>
> Key: FLINK-40567
> URL: https://issues.apache.org/jira/browse/FLINK-40567
> Project: Flink
> Issue Type: Bug
> Components: Runtime / Web Frontend
> Affects Versions: 2.4.0
> Reporter: Purushottam Sinha
> Assignee: Purushottam Sinha
> Priority: Major
> Labels: pull-request-available, test-stability
>
> h3. Problem
> {{HistoryServerArchiveFetcherTest.testLazyFetchArchiveProactively}}
> intermittently fails on master CI during JUnit teardown (not on an
> assertion). The test's {{@TempDir}} cannot be deleted because files under it
> are still present/open, which fails the build.
> h3. Evidence
> * master run [https://github.com/apache/flink/actions/runs/33989974423]
> (module: core, {{flink-runtime-web}}) — Run 1 FAIL, Run 2 PASS (flaky).
> * Failure:
> {noformat}
> org.junit.platform.commons.JUnitException: Failed to close extension context
> Caused by: java.io.IOException: Failed to delete temp directory
> /tmp/junit-6611652694078845454.
> The following paths could not be deleted (see suppressed exceptions for
> details): <root>, jobs
> Suppressed: java.nio.file.DirectoryNotEmptyException:
> /tmp/junit-6611652694078845454
> Suppressed: java.nio.file.DirectoryNotEmptyException:
> /tmp/junit-6611652694078845454/jobs
> {noformat}
> * Test:
> {{flink-runtime-web/src/test/java/org/apache/flink/runtime/webmonitor/history/HistoryServerArchiveFetcherTest.java:373}};
> {{@TempDir}} fields declared at lines 66-67.
> * Distinct from FLINK-40231 (same class, method
> {{testArchiveStateTransition}}, already Resolved).
> h3. Proposed fix
> * Ensure the fetcher/executor writing into the {{jobs}} directory is stopped
> and its handles closed before the test method returns, so {{@TempDir}}
> cleanup finds the directory empty.
> h3. Acceptance
> * Test passes reliably (e.g. repeated/looped local runs) with no "Failed to
> delete temp directory" error.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)