-
-
Notifications
You must be signed in to change notification settings - Fork 978
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 builds when --keepFiles is specified #2423
Conversation
180311f
to
58663f7
Compare
58663f7
to
35da9f9
Compare
Always use same ProgramName regardless of --keepFiles. Include benchmark assembly name in ProgramName.
35da9f9
to
6906de3
Compare
@@ -18,12 +19,20 @@ namespace BenchmarkDotNet.Running | |||
{ | |||
public class BuildPartition | |||
{ | |||
// We use an auto-increment global counter instead of Guid to guarantee uniqueness per benchmark run (Guid has a small chance to collide), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the reason behind the two bug reports a Guid collision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the Guid collision is a side issue. The issues are the program name itself (and thus the output folder based on that program name).
127e8f7
to
8b0bab2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @timcassell !
public BuildPartition(BenchmarkBuildInfo[] benchmarks, IResolver resolver) | ||
{ | ||
Resolver = resolver; | ||
RepresentativeBenchmarkCase = benchmarks[0].BenchmarkCase; | ||
Benchmarks = benchmarks; | ||
ProgramName = benchmarks[0].Config.Options.IsSet(ConfigOptions.KeepBenchmarkFiles) ? RepresentativeBenchmarkCase.Job.FolderInfo : Guid.NewGuid().ToString(); | ||
// Combine the benchmark's assembly name, folder info, and build partition id. | ||
string benchmarkAssemblyName = RepresentativeBenchmarkCase.Descriptor.Type.Assembly.GetName().Name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC Assembly Name should not contain any characters that are invalid for folder names. 👍
Fixes #2411
Fixes #1067