Skip to content

Commit

Permalink
Merge pull request #26 from dedis/shorten-default-timeout
Browse files Browse the repository at this point in the history
Made sync.Timeout a variable, defaulting to 10 seconds
  • Loading branch information
pierluca authored Oct 21, 2023
2 parents 3bd63f4 + 54d5c27 commit 1d36c84
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tidy:

lint:
# Coding style static check.
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.49.0
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54.0
make -C channel lint
make -C sync lint

Expand Down
4 changes: 2 additions & 2 deletions sync/rwmutex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ func parallelReaders() {
doTestParallelReaders(4, 2)
}

func TestParallelReadersDebugOff(t *testing.T) {
func TestParallelReadersDebugOff(_ *testing.T) {
DebugIsOn = false
parallelReaders()
}

func TestParallelReadersDebugOn(t *testing.T) {
func TestParallelReadersDebugOn(_ *testing.T) {
DebugIsOn = true
parallelReaders()
}
Expand Down
4 changes: 2 additions & 2 deletions sync/timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import (
"time"
)

const mutexTimeout = 30 * time.Minute
var Timeout = 10 * time.Second

func startLockTimer(msg string, stack []byte) chan struct{} {
done := make(chan struct{})

go func(s []byte) {
select {
case <-time.After(mutexTimeout):
case <-time.After(Timeout):
Logger.Error().Msgf("%v : %v", msg, string(s))
return
case <-done:
Expand Down
4 changes: 2 additions & 2 deletions sync/waitgroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ func waitGroupAlign() {
x.wg.Wait()
}

func TestWaitGroupAlignDebugOff(t *testing.T) {
func TestWaitGroupAlignDebugOff(_ *testing.T) {
DebugIsOn = false
waitGroupAlign()
}

func TestWaitGroupAlignDebugOn(t *testing.T) {
func TestWaitGroupAlignDebugOn(_ *testing.T) {
DebugIsOn = true
waitGroupAlign()
}

0 comments on commit 1d36c84

Please sign in to comment.