Skip to content

FileSystemWatcher: recreate file/directory on cleanup - #79901

Merged
adamsitnik merged 1 commit into
dotnet:mainfrom
jozkee:fsw_use_cleanup
Dec 22, 2022
Merged

adamsitnik merged 1 commit into
dotnet:mainfrom
jozkee:fsw_use_cleanup

Conversation

@jozkee

@jozkee jozkee commented Dec 22, 2022 •

Copy link
Copy Markdown
Member

The cleanup action is used when the FSW fails to caught the expected event, I noticed that we are deleting files/directories but we are not re-creating them in case the first attempt fails. Hence the occasional DirectoryNotFoundException.

Opposed to #68368, rethinking cleanup actions may be an alternative approach versus retrying a whole test in FSW cc @danmoseley.

Fixes #504.

@jozkee jozkee added this to the 8.0.0 milestone Dec 22, 2022
@jozkee
jozkee requested a review from adamsitnik December 22, 2022 06:26
@jozkee jozkee self-assigned this Dec 22, 2022
@ghost

ghost commented Dec 22, 2022

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-system-io
See info in area-owners.md if you want to be subscribed.

Issue Details

The cleanup action is used when the FSW fails to caught the expected event, I noticed that we are deleting files/directories but we are not re-creating them in case the first attempt fails. Hence the occasional DirectoryNotFoundException.

Opposed to #68368, rethinking cleanup actions may be an alternative approach to retrying a whole test in FSW cc @danmoseley.

Fixes #504.

Author: Jozkee
Assignees: Jozkee
Labels:

area-System.IO

Milestone: 8.0.0

@build-analysis build-analysis Bot mentioned this pull request Dec 22, 2022

@adamsitnik adamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, we definitely need to re-create the file/folder before we try to remove it again.

Thank you for the fix @jozkee !

@adamsitnik
adamsitnik merged commit cd599ec into dotnet:main Dec 22, 2022
@jozkee
jozkee deleted the fsw_use_cleanup branch December 22, 2022 17:26
@ghost ghost locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileSystemWatcher_Directory_Delete_MultipleFilters - DirectoryNotFoundException

2 participants