bradenwright / kitchen-lxd_cli

Test Kitchen driver for LXD
Other
10 stars 4 forks source link

concurrency issue? #17

Open juju4 opened 7 years ago

juju4 commented 7 years ago

Tried to execute test in parallels and in some conditions, it seems to generate container with identical id

$ gem list |grep kitchen
kitchen-ansible (0.45.4)
kitchen-digitalocean (0.9.5)
kitchen-docker (2.6.0)
kitchen-lxd_cli (2.0.1)
kitchen-sync (2.1.1)
kitchen-vagrant (0.20.0)
kitchen-verifier-serverspec (0.5.2)
test-kitchen (1.13.2)
$ kitchen list
Instance             Driver  Provisioner      Verifier  Transport  Last Action
default-ubuntu-1604  LxdCli  AnsiblePlaybook  Busser    Sftp       <Not Created>
default-ubuntu-1404  LxdCli  AnsiblePlaybook  Busser    Sftp       <Not Created>
default-ubuntu-1204  LxdCli  AnsiblePlaybook  Busser    Sftp       <Not Created>
default-centos-7     LxdCli  AnsiblePlaybook  Busser    Sftp       <Not Created>
$ time kitchen test --concurrency 3
-----> Starting Kitchen (v1.13.2)
-----> Cleaning up any prior instances of <default-ubuntu-1604>
-----> Cleaning up any prior instances of <default-ubuntu-1404>
-----> Destroying <default-ubuntu-1404>...
-----> Destroying <default-ubuntu-1604>...
-----> Cleaning up any prior instances of <default-ubuntu-1204>
-----> Destroying <default-ubuntu-1204>...
       Finished destroying <default-ubuntu-1204> (0m0.02s).
-----> Testing <default-ubuntu-1204>
-----> Creating <default-ubuntu-1204>...
       Finished destroying <default-ubuntu-1404> (0m0.02s).
-----> Testing <default-ubuntu-1404>
-----> Creating <default-ubuntu-1404>...
error: not found
-----> Cleaning up any prior instances of <default-centos-7>
-----> Destroying <default-centos-7>...
       Initializing container default-centos-7-1476365945
       Initializing container default-centos-7-1476365945
error: The container already exists
error: The container already exists
       Stopping container default-centos-7-1476365945
error: Container is not running.
       Deleting container default-centos-7-1476365945
       Finished destroying <default-centos-7> (0m1.51s).
-----> Testing <default-centos-7>
-----> Creating <default-centos-7>...
       Initializing container default-centos-7-1476365945
^C

host is ubuntu xenial. Running without concurrency is fine. --parallel gave same result than --concurrency.

Thanks

juju4 commented 7 years ago

Hello @bradenwright and Happy new year!

Had you time to take a look at this? I tried to compare a bit docker driver and lxd_cli but they are organized quiet differently. If I look to https://github.com/test-kitchen/kitchen-docker/issues/49, I can think a mutex would be needed but I'm not sure if it's a problem of communication between kitchen and lxd_cli or just lxd_cli as kitchen message seems coherent.

Thanks

bradenwright commented 7 years ago

So I had time to look at it on a couple of occasions, I probably should have posted when I did but I never really was able to find much/get much traction. For me I have errors/formatting issues everytime, but don't know a ton about kitchen/debugging this. I'll try to spend a little more time soon to get my head back into it and then I guess will probably hop on IRC and see if anyone there has ideas. I'll have time this weekend to get started. but biggest issue right now is I really don't have much idea on where to start. I'll look over kitchen-docker link and see if that gives me any revelations.