Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
make ${{ matrix.target }}

binary:
uses: docker/github-builder/.github/workflows/bake.yml@v1
uses: docker/github-builder/.github/workflows/bake.yml@v1.4.0
permissions:
contents: read # same as global permission
id-token: write # for signing attestation(s) with GitHub OIDC Token
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:

bin-image-test:
if: github.event_name == 'pull_request'
uses: docker/github-builder/.github/workflows/bake.yml@v1
uses: docker/github-builder/.github/workflows/bake.yml@v1.4.0
with:
runner: amd64
target: image-cross
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
- run: echo "Exposing env vars for reusable workflow"

bin-image:
uses: docker/github-builder/.github/workflows/bake.yml@v1
uses: docker/github-builder/.github/workflows/bake.yml@v1.4.0
needs:
- bin-image-prepare
permissions:
Expand Down
2 changes: 1 addition & 1 deletion cmd/display/tty.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ func (w *ttyWriter) Start(ctx context.Context, operation string) {

func (w *ttyWriter) Done(operation string, success bool) {
w.print()
w.done <- true
w.mtx.Lock()
defer w.mtx.Unlock()
if w.ticker != nil {
w.ticker.Stop()
}
w.operation = ""
w.done <- true
}

func (w *ttyWriter) On(events ...api.Resource) {
Expand Down
21 changes: 21 additions & 0 deletions cmd/display/tty_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package display

import (
"bytes"
"context"
"strings"
"sync"
"testing"
Expand Down Expand Up @@ -422,3 +423,23 @@ func TestLenAnsi(t *testing.T) {
})
}
}

func TestDoneDeadlockFix(t *testing.T) {
w, _ := newTestWriter()
addTask(w, "test-task", "Working", "details", api.Working)
ctx, cancel := context.WithCancel(t.Context())
defer cancel()

w.Start(ctx, "test")
done := make(chan bool)
go func() {
w.Done("test", true)
done <- true
}()

select {
case <-done:
case <-time.After(5 * time.Second):
t.Fatal("Deadlock detected: Done() did not complete within 5 seconds")
}
}
Loading