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

[Harness] Make sure we do not copy/generate the app sources more than once. #8243

Merged
merged 2 commits into from
Mar 31, 2020

Conversation

mandel-macaque
Copy link
Member

@mandel-macaque mandel-macaque commented Mar 30, 2020

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

… 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
@mandel-macaque mandel-macaque added the run-bcl-tests Run the BCL tests label Mar 30, 2020
return;
// mk the expected directories
if (Directory.Exists (srcOuputPath))
Directory.Delete (srcOuputPath, true); // delete, we always want to add the embeded src
Copy link
Contributor

Choose a reason for hiding this comment

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

tiny nit: embedded

@monojenkins
Copy link
Collaborator

Build failure
Build failed or was aborted

Build succeeded
API Diff (from stable)

Copy link
Member

@dalexsoto dalexsoto left a comment

Choose a reason for hiding this comment

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

lock(manuel) 👍

@monojenkins
Copy link
Collaborator

Build success
Build succeeded
API Diff (from stable)
API Diff (from PR only) (no change)
Generator Diff (no change)
Test run succeeded

@mandel-macaque mandel-macaque merged commit 63fcc22 into master Mar 31, 2020
@mandel-macaque mandel-macaque deleted the issue-8240 branch March 31, 2020 01:20
@xamarin-release-manager
Copy link
Collaborator

Build was (probably) aborted

🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Checkout' 🔥 : hudson.AbortException: script returned exit code 128

@xamarin-release-manager
Copy link
Collaborator

Build was (probably) aborted

🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Checkout' 🔥 : hudson.AbortException: script returned exit code 128

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-bcl-tests Run the BCL tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Harness] If generated source dir does not exist, we throw an exception.
6 participants