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

Fixed TRX file overwrite in certain circumstances #2508

Merged
16 commits merged into from
Aug 7, 2020

Conversation

Haplois
Copy link
Contributor

@Haplois Haplois commented Aug 4, 2020

Description

Checks the target file name for saving the TRX logs and insures it is distinct. This check does not occur if a filename is implicitly set, in this case file will be overwritten and a warning is shown.

Related issue

Fixes #2489

@Haplois Haplois requested a review from nohwnd August 4, 2020 16:00
@Haplois Haplois changed the title Initial fixes. Fixed TRX file overwrite in certain circumstances Aug 4, 2020
@Haplois Haplois marked this pull request as ready for review August 4, 2020 16:03
@ghost
Copy link

ghost commented Aug 4, 2020

Hello @Haplois!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@nohwnd nohwnd removed the auto-merge label Aug 4, 2020
Copy link
Member

@nohwnd nohwnd left a comment

Choose a reason for hiding this comment

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

I would avoid using pessimistic concurrency, and instead bump the timestamp when we get a conflict. Maybe pass the trx filename as an object / strategy that can easily regenerate it, or if that would change the public APIs just use our knowledge of the format (as you already do) and bump the timestamp and retry.

@Haplois Haplois requested a review from nohwnd August 5, 2020 09:44
@nohwnd
Copy link
Member

nohwnd commented Aug 5, 2020

I did have a look, as you requested, and it still seems very complex for what is basically a retry operation, but maybe I am not grasping the details.

I think it might get easier if we passed in an object that contains the raw data that we used to generated the filename and provides a method to get Next, and it also indicates whether or not we should be rewriting because based on whether the user provided the name or not. At least that is how I understand from you this is determined. This would avoid the timestamp parsing code, and it looks like all the appropriate methods are internal so we should not have problem with changing public APIs.

Let's talk about this a bit more during our sync.

@ghost ghost merged commit de02d84 into microsoft:master Aug 7, 2020
@Haplois Haplois deleted the fix/dotnet-test-overwrite-2489 branch August 7, 2020 13:47
This pull request was closed.
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.

dotnet test: warning: Overwriting results file: duplicate trx file
3 participants