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

One TempDirectory For all performance tests #11203

Merged
merged 3 commits into from
May 10, 2016

Conversation

basoundr
Copy link
Contributor

@basoundr basoundr commented May 9, 2016

There are 2 reasons.

  1. We are running into errors trying to unzip test solutions in the temp folder which is rooted deep inside the binaries folder
  2. When trying to run the tests again, we need to delete the temp directories of each directory separately because we could pick up csx files from the test files.

We could solve the 2nd issue by cleaning up after the run. But the 1st issue still stands

Tagging @TyOverby @KevinH-MS @rchande for review

var path = Path.Combine(workingDir, "temp");
Directory.CreateDirectory(path);
return path;
var tempDirectory = Path.Combine(Environment.ExpandEnvironmentVariables("%SYSTEMDRIVE%")+@"\", "PerfTemp");
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we get away with something under %USERPROFILE%?

Copy link
Contributor

Choose a reason for hiding this comment

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

+"\" shouldn't be necessary with Path.Combine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

%USERPROFILE%has the same issue of rooting our test solution deep inside and it will result in Path names longer than 265 characters limit error again. Thats why I wanted the minimal root path. Also our previous test infra had test solution in C:\Roslyn\

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Path.Combine works only for joining Directories. We need to explicitly mention the \. (Tested it)

Copy link
Contributor

@KevinH-MS KevinH-MS May 10, 2016

Choose a reason for hiding this comment

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

Re: %USERPROFILE% vs %SYSTEMDRIVE%, ok.

Re: @"\", I see...%SYSTEMDRIVE% is just "C:". It might be clearer to just do:

Environment.ExpandEnvironmentVariables("%SYSTEMDRIVE%") + "\PerfTemp"

Path.Combine isn't really buying us any additional safety, because we're assuming %SYSTEMDRIVE% never ends in a path separator, and just glancing at this code, it looks like a bug to be using Path.Combine and an explicit directory separator (the whole point of Path.Combine being to avoid assumptions about directory separators).

@KevinH-MS
Copy link
Contributor

LGTM, but I'm curious to know if we ever clean up the temp folder anywhere.

There are 2 reasons.
1. We are running into errors trying to unzip test solutions in the temp folder which is rooted deep inside the binaries folder
2. When trying to run the tests again, we need to delete the temp directories of each directory separately because we could pick up csx files from the test files.

We could solve the 2nd issue by cleaning up after the run. But the 1st issue still stands
Since we dont run the iterations as a scenario, we dont need to number the scenarios
@basoundr basoundr merged commit 304244a into dotnet:master May 10, 2016
@basoundr basoundr deleted the OneTempDirectory branch May 10, 2016 16:33
@AdamSpeight2008
Copy link
Contributor

Is this also implemented in the Future branch?

@TyOverby
Copy link
Contributor

@AdamSpeight2008 It has probably flowed into the Future branch by now.

If you wanted to check, you could use git to see if the commit 2563c23 exists in future

@AdamSpeight2008
Copy link
Contributor

AdamSpeight2008 commented May 18, 2016

@TyOverby
Appears be there, but still appears to produce multiple folders.
Does VB use a different one?

@TyOverby
Copy link
Contributor

I'm pretty sure we don't have any VB perf tests in the new system yet. Are you sure you're looking at the right code?

@AdamSpeight2008
Copy link
Contributor

I'm using the cmd msbuild /v:m /m BuildAndTest.proj and my \Temp folder get inundated with lots of temporary folders. I think we should use a single folder, then generate the subsequent folder and files within that. So at the end we can just delete a single folder to tidy up.

@TyOverby
Copy link
Contributor

TyOverby commented May 18, 2016

That is unrelated to this PR. I've renamed the issue to make this more clear.

@TyOverby TyOverby changed the title One TempDirectory For all tests One TempDirectory For all performance tests May 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants