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

[VFS-856] Fix JunctionTests #663

Merged
merged 1 commit into from
Feb 14, 2025
Merged

Conversation

raboof
Copy link
Member

@raboof raboof commented Feb 14, 2025

The test would leave a file behind, causing it to fail the next time it runs (e.g. impacting 'mvn install')

  • Read the contribution guidelines for this project.
  • Run a successful build using the default Maven goal with mvn; that's mvn on the command line by itself.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible but is a best-practice.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body. Note that commits might be squashed by a maintainer on merge.

@garydgregory garydgregory changed the title [VFS-856] fix JunctionTests [VFS-856] Fix JunctionTests Feb 14, 2025
@@ -141,6 +141,9 @@ public void testEvent() throws Exception {
final FileObject real2 = baseDir.resolveFile("weakref.txt");
real2.createFile();
assertEquals("Weak Listener was abandoned", "Listener false true false", listener2.toString());

// Make sure we don't contaminate the fs for the next time the test runs
assertTrue(file2.delete());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @raboof
If you want this to happen 100% of the time, as opposed to not if an assertion fails, you must put it in a finally block.

The test would leave a file behind, causing it to fail
the next time it runs (e.g. impacting 'mvn install')
@garydgregory garydgregory merged commit 6837fa8 into apache:master Feb 14, 2025
19 of 21 checks passed
@garydgregory
Copy link
Member

TY @raboof !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants