• Bug#1071035: FAIL: TestGroup_deadlock

    From Reinhard Tartler@21:1/5 to All on Mon May 13 14:40:01 2024
    Control: tag -1 patch

    I've filed https://github.com/fatih/semgroup/pull/7 as a workaround.

    Anthony, what's your take on this, should we include that patch in the Debian Package?

    -rt

    From bb5f94c0d8e6ddf1f24f673303d73e84c285e1ac Mon Sep 17 00:00:00 2001
    From: Reinhard Tartler <siretart@tauware.de>
    Date: Mon, 13 May 2024 08:31:03 -0400
    Subject: [PATCH] chore: bump x/sync to 0.7

    Note that this version changes the behavior of semaphore slightly.
    After https://cs.opensource.google/go/x/sync/+/14be23e5b48bec28285f8a694875175ecacfddb3
    the semaphore package will reliably raise errors for both go routines

    change the test to test for a substring to be more relaxed in case that behavior gets reverted
    ---
    go.mod | 2 +-
    go.sum | 4 ++--
    semgroup_test.go | 8 ++++----
    3 files changed, 7 insertions(+), 7 deletions(-)

    diff --git a/go.mod b/go.mod
    index 1a651d6..5926c6b 100644
    --- a/go.mod
    +++ b/go.mod
    @@ -2,4 +2,4 @@ module github.com/fatih/semgroup

    go 1.17

    -require golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
    +require golang.org/x/sync v0.7.0
    diff --git a/go.sum b/go.sum
    index 5c00efd..e8ef4a3 100644
    --- a/go.sum
    +++ b/go.sum
    @@ -1,2 +1,2 @@
    -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ=
    -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
    +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
    diff --git a/semgroup_test.go b/semgroup_test.go
    index 255206d..3c90bf6 100644
    --- a/semgroup_test.go
    +++ b/semgroup_test.go
    @@ -4,6 +4,7 @@ imp
  • From Reinhard Tartler@21:1/5 to All on Mon May 13 15:00:02 2024
    Control: reassign -1 golang-golang-x-sync 0.7.0
    Control: affects -1 golang-github-fatih-semgroup

    This seems to be related to upgrading golang-golang-x-sync to 0.7.0.

    This is how to reproduce is using pristine upstream sources:

    siretart@x1:/tmp/docker.io $ git clone https://github.com/fatih/semgroup Cloning into 'semgroup'...
    remote: Enumerating objects: 46, done.
    remote: Counting objects: 100% (46/46), done.
    remote: Compressing objects: 100% (37/37), done.
    remote: Total 46 (delta 23), reused 21 (delta 7), pack-reused 0
    Receiving objects: 100% (46/46), 10.49 KiB | 10.49 MiB/s, done.
    Resolving deltas: 100% (23/23), done.
    siretart@x1:/tmp/docker.io $ cd ./semgroup/
    siretart@x1:/tmp/docker.io/semgroup $ go mod edit -require golang.org/x/sync@v0.7.0
    siretart@x1:/tmp/docker.io/semgroup $ go mod tidy siretart@x1:/tmp/docker.io/semgroup $ go test -vet=off -v -p 8 github.com/fatih/semgroup
    === RUN TestGroup_single_task
    --- PASS: TestGroup_single_task (0.00s)
    === RUN TestGroup_multiple_tasks
    --- PASS: TestGroup_multiple_tasks (0.00s)
    === RUN TestGroup_multiple_tasks_errors
    --- PASS: TestGroup_multiple_tasks_errors (0.00s)
    === RUN TestGroup_deadlock
    semgroup_test.go:92: error should be:
    1 error(s) occurred:
    * couldn't acquire semaphore: context canceled
    got:
    2 error(s) occurred:
    * couldn't acquire semaphore: context canceled
    * couldn't acquire semaphore: context canceled
    --- FAIL: TestGroup_deadlock (0.00s)
    === RUN TestGroup_multiple_tasks_errors_Is
    --- PASS: TestGroup_multiple_tasks_errors_Is (0.00s)
    === RUN TestGroup_multiple_tasks_errors_As
    --- PASS: TestGroup_multiple_tasks_errors_As (0.00s)
    === RUN ExampleGroup_parallel
    --- PASS: ExampleGroup_parallel (0.00s)
    === RUN ExampleGroup_withErrors
    --- PASS: ExampleGroup_withErrors (0.00s)
    FAIL
    FAIL github.com/fatih/semgroup 0.002s
    FAIL

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet