-
Notifications
You must be signed in to change notification settings - Fork 520
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
[Harness] Make sure we do not copy/generate the app sources more than once. #8243
Conversation
… once. Threading is hard, even with async. We reached a situation in which the src code of the test applications from the template was being generated more thanonce. Ideally, we could have a nice solution with AsyncLazy<bool> and use the lazy async to copy the code, but it was moved to netcore 5. The fix is a little uglier but valid, lock and enure we only generate it once. Please note that you CANNOT use a lock statement inside a async method. Fixes: #8240
return; | ||
// mk the expected directories | ||
if (Directory.Exists (srcOuputPath)) | ||
Directory.Delete (srcOuputPath, true); // delete, we always want to add the embeded src |
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.
tiny nit: embedded
Build failure |
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.
lock(manuel) 👍
Build success |
❌ Build was (probably) aborted 🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Checkout' 🔥 : hudson.AbortException: script returned exit code 128 |
❌ Build was (probably) aborted 🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Checkout' 🔥 : hudson.AbortException: script returned exit code 128 |
Threading is hard, even with async. We reached a situation in which the
src code of the test applications from the template was being generated
more than once. Ideally, we could have a nice solution with
AsyncLazy and use the lazy async to copy the code, but it was
moved to netcore 5. The fix is a little uglier but valid, lock and
enure we only generate it once. Please note that you CANNOT use a lock
statement inside a async method.
Fixes: #8240