Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK] Fix flakey test #10569

Open
Fokko opened this issue Jun 25, 2024 · 3 comments
Open

[SPARK] Fix flakey test #10569

Fokko opened this issue Jun 25, 2024 · 3 comments
Labels
good first issue Good for newcomers improvement PR that improves existing functionality spark

Comments

@Fokko
Copy link
Contributor

Fokko commented Jun 25, 2024

Feature Request / Improvement

I noticed this one the other day:

TestDataFrameWrites > testFaultToleranceOnWrite() > format = orc FAILED
    java.io.IOException: Failed to delete temp directory /tmp/junit10947448527164022571. The following paths could not be deleted (see suppressed exceptions for details): <root>
        at org.junit.jupiter.engine.extension.TempDirectory$CloseablePath.createIOExceptionWithAttachedFailures(TempDirectory.java:431)
        at org.junit.jupiter.engine.extension.TempDirectory$CloseablePath.close(TempDirectory.java:312)

I don't think we want to fail if a temp path cannot be deleted.

Query engine

None

@Fokko Fokko added improvement PR that improves existing functionality good first issue Good for newcomers spark labels Jun 25, 2024
@manuzhang
Copy link
Contributor

Duplicate of #10480?

@nk1506
Copy link
Contributor

nk1506 commented Jun 27, 2024

@Fokko / @manuzhang , With TempDirectory , CleanupMode is ALWAYS as default. Means it always try to delete the temp directory after the test case execution.
What will be harm if we disable the clean up? Means something like @TempDir(cleanup = CleanupMode.NEVER) this we can do.
Since with every test and format the directory location is unique. It will never overlap with each other. Only immediate side effects I am seeing here is occupying this space for sometime.

The cause of this issue is

if (this.cleanupMode != CleanupMode.NEVER && (this.cleanupMode != CleanupMode.ON_SUCCESS || !TempDirectory.selfOrChildFailed(this.extensionContext))) {
                    FileOperations fileOperations = (FileOperations)this.extensionContext.getStore(TempDirectory.NAMESPACE).getOrDefault("file.operations", FileOperations.class, TempDirectory.FileOperations.DEFAULT);
                    SortedMap<Path, IOException> failures = this.deleteAllFilesAndDirectories(fileOperations);
                    if (failures.isEmpty()) {
                        return;
                    }

                    throw this.createIOExceptionWithAttachedFailures(failures);
                }

WDYT ?

@ismailsimsek
Copy link
Contributor

Might be related to unclosed resources, similar reports here and here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers improvement PR that improves existing functionality spark
Projects
None yet
Development

No branches or pull requests

4 participants