test(bolt): fix data race
Multiple goroutines were concurrently setting bolt.HashCost. Move the assignment to an init function to avoid the data race.pull/10616/head
parent
ed4bba83f5
commit
6874607796
|
@ -12,9 +12,12 @@ import (
|
|||
"golang.org/x/crypto/bcrypt"
|
||||
)
|
||||
|
||||
func init() {
|
||||
bolt.HashCost = bcrypt.MinCost
|
||||
}
|
||||
|
||||
func NewTestClient() (*bolt.Client, func(), error) {
|
||||
c := bolt.NewClient()
|
||||
bolt.HashCost = bcrypt.MinCost
|
||||
|
||||
f, err := ioutil.TempFile("", "influxdata-platform-bolt-")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue