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

Fix TempFile usage while temp dir was deleted in same process #1132

Merged
merged 29 commits into from
Apr 26, 2024

Conversation

Bykiev
Copy link
Collaborator

@Bykiev Bykiev commented Jul 27, 2023

This PR closes #926

@Bykiev Bykiev marked this pull request as draft July 27, 2023 08:55
@Bykiev
Copy link
Collaborator Author

Bykiev commented Jul 27, 2023

Cannot make test running on CI, help is wanted. It seems they're running in parallel, I've tried to add [NonParallelizable] and [SingleThreaded] attributes with no luck

{
dir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), "poifiles")).FullName;
string tempDir = Path.Combine(Path.GetTempPath(), "poifiles");
dir = Directory.CreateDirectory(tempDir).FullName;
Copy link
Collaborator

Choose a reason for hiding this comment

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

CreateDirectory always called so shouldn't actually be dir be assigned tempdirs value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't change much code, but dir variable doesn't needed at all


if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);

Random rnd = new Random(DateTime.Now.Millisecond);
Thread.Sleep(10);
Copy link
Collaborator Author

@Bykiev Bykiev Jul 27, 2023

Choose a reason for hiding this comment

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

What is the purpose of Thread.Sleep?

@Bykiev Bykiev mentioned this pull request Sep 9, 2023
@tonyqus tonyqus added the bug label Dec 14, 2023
@tonyqus tonyqus added this to the NPOI 2.7.1 milestone Dec 14, 2023
@Bykiev Bykiev marked this pull request as ready for review March 12, 2024 16:20
@Bykiev Bykiev requested a review from lahma March 12, 2024 16:20
@Bykiev Bykiev requested a review from tonyqus April 3, 2024 09:52
@tonyqus
Copy link
Member

tonyqus commented Apr 26, 2024

@Bykiev There is a conflict. Can you fix it?

@tonyqus
Copy link
Member

tonyqus commented Apr 26, 2024

LGTM

@tonyqus tonyqus merged commit 31d087c into nissl-lab:master Apr 26, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CreateTempFile throws DirectoryNotFoundException for SXSSFWorkbook
3 participants