adjust logs

This commit is contained in:
chrislu
2023-09-21 23:51:32 -07:00
parent 3e23421608
commit 2df70ce95f
2 changed files with 24 additions and 17 deletions

View File

@@ -1,6 +1,7 @@
package util
import (
"fmt"
"math/rand"
"sync"
"testing"
@@ -26,14 +27,14 @@ func TestOrderedLock(t *testing.T) {
lock := lt.AcquireLock("", key, lockType)
// Lock acquired, perform some work
glog.V(4).Infof("ActiveLock %d acquired the lock.\n", lock.ID)
fmt.Printf("ActiveLock %d acquired lock %v\n", lock.ID, lockType)
// Simulate some work
time.Sleep(time.Duration(rand.Int31n(10)*10) * time.Millisecond)
// Release the lock
lt.ReleaseLock(key, lock)
glog.V(4).Infof("ActiveLock %d released the lock.\n", lock.ID)
fmt.Printf("ActiveLock %d released lock %v\n", lock.ID, lockType)
}(i)
}