Skip to content

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

Merged
mandel-macaque merged 2 commits into
masterfrom
issue-8240
Mar 31, 2020
Merged

[Harness] Make sure we do not copy/generate the app sources more than once.#8243
mandel-macaque merged 2 commits into
masterfrom
issue-8240

Conversation

@mandel-macaque

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

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

Build failure
Build failed or was aborted

Build succeeded
API Diff (from stable)

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
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