-
Notifications
You must be signed in to change notification settings - Fork 95
Add clone and single vm concurrent tests #802
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new code looks good to me with a few nits. There is a comment about older parallel test - please take a look
@@ -240,7 +242,7 @@ func TestSanity(t *testing.T) { | |||
"size": "1gb", | |||
}, | |||
} | |||
// Create/delete routine | |||
// Create/delete goroutine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the problem here - which I observed on my testbed- is that if there is a client in clients more than once, the code below (go func) fails because ESX rejects reconfigure request on the same VM when another one is in flight.
and our current Makefiles allow for VM1 and VM2 (test clients) to be the same - in fact this is how single VM testing is done.
I'd suggest checking for this and warn then skip duplicate clients. Yes, it will skip the parallel test but will unblock single VM test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't aware of that possibility, or the fact that esx would error out. But independently of skipping the tests for that specific scenario we should serialize reconfig tasks per vm in vmdk_ops.
for idx, elem := range clients { | ||
go func(idx int, c *client.Client) { | ||
for i := 0; i < parallelClones; i++ { | ||
volName := masterVolName + "-clone" + strconv.Itoa(idx) + strconv.Itoa(i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: formatting with fmt. is easier to read IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
} | ||
|
||
// Read the results from the channel | ||
for i := 0; i < len(clients)*parallelClones*2; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: do we need spaces around * ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is done by gofmt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore my comment about * then :-)
@@ -41,6 +41,7 @@ const ( | |||
defaultTestLogPath = "/tmp/test-docker-volume-vsphere.log" | |||
// Number of volumes per client for parallel tests | |||
parallelVolumes = 9 | |||
parallelClones = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: both these constants seem prime candidates for test arguments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes :)
@msterin |
IMO either way is fine as long as there are 2 separate commits |
1cab00c
to
6905a24
Compare
6905a24
to
8eefdfb
Compare
And it does fail:
Until #810 is in, this one has to wait to avoid breaking the master |
@msterin |
Add getClients() for client init/connect Change parallel* constants to flags @msterin
8eefdfb
to
ded8451
Compare
Fixes #772