Skip to content

Synchronize concurrent tasks #4898

Description

@MarcoRossignoli

Hi here Marco from coverlet https://github.com/tonerdo/coverlet

One of most requested feature is "Solution wide coverage".

To do that we need to sync/communicate with concurrent running task https://github.com/tonerdo/coverlet/tree/master/src/coverlet.msbuild.tasks

Is there a build-in mechanism?
If I run for instance dotnet test /p:CollectCoverage=true MergeWith.sln (coverlet-coverage/coverlet#598 (comment)) I see overlapping task instances and concurrent tests.
We should sync CoverageResultTask https://github.com/tonerdo/coverlet/blob/master/src/coverlet.msbuild.tasks/CoverageResultTask.cs#L73 and wait all tests and merge results.

Is there a way/pattern to do this?Or we need to implement custom sync/interprocess communication(we need a unique identifier to group task of same sln build)?

cc: @tonerdo

Activity

  1. changed the title [-]Syncronize concurrent tasks[/-] [+]Synchronize concurrent tasks[/+] on Nov 7, 2019
  2. rainersigwald commented on Nov 7, 2019

    @rainersigwald
    Member

    There is no built-in mechanism for this. In addition, people rolling their own locks have a long, sad history of causing confusing, hard-to-debug build breaks and hangs. So please consider whether there's any way you can redesign to avoid the need for the synchronization.

  3. added this to the Discussion milestone on Nov 7, 2019
  4. MarcoRossignoli commented on Nov 8, 2019

    @MarcoRossignoli
    MemberAuthor

    There is no built-in mechanism for this. In addition, people rolling their own locks have a long, sad history of causing confusing, hard-to-debug build breaks and hangs. So please consider whether there's any way you can redesign to avoid the need for the synchronization.

    Eh...it's also my concern 😞 but users complain about the fact that msbuild works only with "project" and there are some tool/fields that need to be grouped to "solution" to be useful.
    Users want only 1 coverage report file but we can run task only "project based" and also runs in parallel

    Thank's for quick response @rainersigwald if you've some link on docs or some project that tackled this problem let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: EngineIssues impacting the core execution of targets and tasks.questiontriaged

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions