mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
execdriver/lxc: use local rand.Random in test
Preventing the test execution to pollute the deterministic runtime environment by seeding the global rand.Random. Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
This commit is contained in:
parent
7233bd223d
commit
c2c45d7769
1 changed files with 3 additions and 3 deletions
|
@ -29,14 +29,14 @@ func TestLXCConfig(t *testing.T) {
|
|||
os.MkdirAll(path.Join(root, "containers", "1"), 0777)
|
||||
|
||||
// Memory is allocated randomly for testing
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
r := rand.New(rand.NewSource(time.Now().UTC().UnixNano()))
|
||||
var (
|
||||
memMin = 33554432
|
||||
memMax = 536870912
|
||||
mem = memMin + rand.Intn(memMax-memMin)
|
||||
mem = memMin + r.Intn(memMax-memMin)
|
||||
cpuMin = 100
|
||||
cpuMax = 10000
|
||||
cpu = cpuMin + rand.Intn(cpuMax-cpuMin)
|
||||
cpu = cpuMin + r.Intn(cpuMax-cpuMin)
|
||||
)
|
||||
|
||||
driver, err := NewDriver(root, root, "", false)
|
||||
|
|
Loading…
Reference in a new issue