unittests: ec2 tests escape to network
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Medium
|
Chad Smith |
Bug Description
On Aug 10, 2017 the nightly and CI tests began taking 20 additional minutes. The additional time is occurring during the tox run, specifically during the 'py27' and 'xenial' environments. Here are comparisons of run times:
Aug 8: 1 min 52 seconds
Aug 9: 1 min 47 seconds
Aug 10: 19 mins
These tests are run at ~23:40 UTC each day, therefore a change would have occurred during the day resulting in the end-of-day run to see the effect.
From the Aug 10 run these two tox environments are adding a huge amount of time:
py27: Ran 980 tests in 525.871s
xenial: Ran 980 tests in 518.678s
Here are timing results from the Aug 9 run:
py27: Ran 978 tests in 9.051s
xenial: Ran 978 tests in 14.122s
Per the git log I believe it is tied to this revision:
https:/
Which added two new tests:
test_ec2_
test_ec2_
hence the increase the number of tests run. I am not however, saying that these two tests are the cause of the additional test time.
Related branches
- Server Team CI bot: Approve (continuous-integration)
- Joshua Powers (community): Approve
- cloud-init Commiters: Pending requested
-
Diff: 102 lines (+30/-16)1 file modifiedtests/unittests/test_datasource/test_ec2.py (+30/-16)
Changed in cloud-init: | |
status: | New → Confirmed |
summary: |
- tox: long CI times + unittests: ec2 tests escape to network |
Changed in cloud-init: | |
status: | Confirmed → In Progress |
importance: | Undecided → Medium |
assignee: | nobody → Chad Smith (chad.smith) |
Changed in cloud-init: | |
status: | In Progress → Fix Committed |
Diagnosed which test it was with:
$ git clone https:/ /git.launchpad. net/cloud- init
$ cd cloud-init
$ nosetests --with-timer --timer-ok 1 --timer-warning 5
This results in a sorted listed list of all tests with timing in green if less than 1 second, yellow if between 1 and 5 seconds, and red if greater than 5 seconds. All tests were less than one second, except these:
[success] 19.54% tests.unittests .test_datasourc e.test_ ec2.TestEc2. test_unknown_ platform_ with_strict_ false: 127.3695s .test_datasourc e.test_ ec2.TestEc2. test_valid_ platform_ with_strict_ true: 127.3614s .test_datasourc e.test_ ec2.TestEc2. test_valid_ platform_ with_strict_ false: 127.3573s .test_datasourc e.test_ ec2.TestEc2. test_network_ config_ property_ returns_ version_ 1_network_ data: 127.3403s .test_datasourc e.test_ ec2.TestEc2. test_ec2_ local_performs_ dhcp_on_ non_bsd: 127.3302s .test_datasourc e.test_ openstack. TestOpenStackDa taSource. test_datasource : 5.0584s .test_datasourc e.test_ openstack. TestOpenStackDa taSource. test_bad_ datasource_ meta: 5.0298s
[success] 19.54% tests.unittests
[success] 19.54% tests.unittests
[success] 19.54% tests.unittests
[success] 19.54% tests.unittests
[success] 0.78% tests.unittests
[success] 0.77% tests.unittests
These account for 99.25% of the run time.