Skip to content

Commit

Permalink
Merge pull request #977 from iotaledger/fix/dockertest-framework
Browse files Browse the repository at this point in the history
Fix panic send on closed channel in DockerTestFramework
  • Loading branch information
muXxer authored May 20, 2024
2 parents f424ed4 + ab7a360 commit 1f0661e
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tools/docker-network/tests/dockertestframework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ func (d *DockerTestFramework) Run() error {

ch := make(chan error)
stopCh := make(chan struct{})
defer close(ch)
defer close(stopCh)

defer func() {
close(stopCh)
close(ch)
}()

ts := time.Now()
go func() {
Expand All @@ -149,10 +152,14 @@ func (d *DockerTestFramework) Run() error {
select {
case <-stopCh:
return

default:
select {
case <-stopCh:
return
case ch <- err:
}
}

ch <- err
}()

timer := time.NewTimer(d.optsWaitForSync)
Expand Down

0 comments on commit 1f0661e

Please sign in to comment.