Merge lp:~vila/uci-engine/nova-failure-as-testbed-exception into lp:uci-engine

Proposed by Vincent Ladeuil on 2015-01-08
Status: Merged
Approved by: Ursula Junque on 2015-01-08
Approved revision: 916
Merged at revision: 916
Proposed branch: lp:~vila/uci-engine/nova-failure-as-testbed-exception
Merge into: lp:uci-engine
Diff against target: 56 lines (+17/-6)
2 files modified
test_runner/tstrun/testbed.py (+14/-3)
test_runner/tstrun/tests/test_testbed.py (+3/-3)
To merge this branch: bzr merge lp:~vila/uci-engine/nova-failure-as-testbed-exception
Reviewer Review Type Date Requested Status
Para Siva (community) 2015-01-08 Approve on 2015-01-08
Review via email: mp+245831@code.launchpad.net

Commit message

Turn nova exceptions into TestBedException to identify infra failures

Description of the change

Re-focusing from the nova-failure branch, this MP doesn't try to re-enable the Nova and Swift features.

To post a comment you must log in.
Para Siva (psivaa) wrote :

Do you not have to remove the decorators for the TestNovaClient in order to enable the modified tests to run without Nova and Swift features?

Vincent Ladeuil (vila) wrote :

> Do you not have to remove the decorators for the TestNovaClient in order to
> enable the modified tests to run without Nova and Swift features?

That would going in the wrong direction: we want to keep the decorators as they define the context of the test.

It's unfortunate that we can't run those tests on tarmac but that's unrelated to this MP and the reason why I split it ;)

Para Siva (psivaa) wrote :

Ack, understood. Approving this MP and will take a look at the other too. Thanks for clarifying

review: Approve
Ubuntu CI Bot (uci-bot) wrote :
Download full text (59.9 KiB)

The attempt to merge lp:~vila/uci-engine/nova-failure-as-testbed-exception into lp:uci-engine failed. Below is the output from the failed tests.

2015-01-08 11:42:25 INFO juju.cmd supercommand.go:37 running jujud [1.20.14.1-precise-amd64 gc]
2015-01-08 11:42:25 DEBUG juju.agent agent.go:377 read agent config, format "1.18"
2015-01-08 11:42:25 INFO juju.jujud unit.go:78 unit agent unit-ci-airline-ts-django-0 start (1.20.14.1-precise-amd64 [gc])
2015-01-08 11:42:25 INFO juju.worker runner.go:260 start "api"
2015-01-08 11:42:25 INFO juju.state.api apiclient.go:242 dialing "wss://10.0.3.1:17070/"
2015-01-08 11:42:25 INFO juju.state.api apiclient.go:176 connection established to "wss://10.0.3.1:17070/"
2015-01-08 11:42:25 INFO juju.state.api apiclient.go:242 dialing "wss://10.0.3.1:17070/"
2015-01-08 11:42:25 INFO juju.state.api apiclient.go:176 connection established to "wss://10.0.3.1:17070/"
2015-01-08 11:42:26 INFO juju.state.api apiclient.go:242 dialing "wss://10.0.3.1:17070/"
2015-01-08 11:42:26 INFO juju.state.api apiclient.go:176 connection established to "wss://10.0.3.1:17070/"
2015-01-08 11:42:26 INFO juju.worker runner.go:260 start "upgrader"
2015-01-08 11:42:26 INFO juju.worker runner.go:260 start "logger"
2015-01-08 11:42:26 DEBUG juju.worker.logger logger.go:35 initial log config: "<root>=DEBUG"
2015-01-08 11:42:26 INFO juju.worker runner.go:260 start "uniter"
2015-01-08 11:42:26 DEBUG juju.worker.logger logger.go:60 logger setup
2015-01-08 11:42:26 INFO juju.worker runner.go:260 start "apiaddressupdater"
2015-01-08 11:42:26 INFO juju.worker runner.go:260 start "rsyslog"
2015-01-08 11:42:26 DEBUG juju.worker.rsyslog worker.go:75 starting rsyslog worker mode 1 for "unit-ci-airline-ts-django-0" "tarmac-local"
2015-01-08 11:42:26 DEBUG juju.worker.logger logger.go:45 reconfiguring logging from "<root>=DEBUG" to "<root>=WARNING;unit=DEBUG"
2015-01-08 11:42:33 INFO juju-log Making dir /srv/ci-airline-ts-django/code/ root:root 555
2015-01-08 11:42:33 INFO juju-log Adding dependencies.
2015-01-08 11:42:33 INFO juju-log installing apt packages...
2015-01-08 11:42:44 INFO config-changed gpg: keyring `/tmp/tmpydV9YC/secring.gpg' created
2015-01-08 11:42:44 INFO config-changed gpg: keyring `/tmp/tmpydV9YC/pubring.gpg' created
2015-01-08 11:42:44 INFO config-changed gpg: requesting key 6A8DFC40 from hkp server keyserver.ubuntu.com
2015-01-08 11:42:44 INFO config-changed gpg: /tmp/tmpydV9YC/trustdb.gpg: trustdb created
2015-01-08 11:42:44 INFO config-changed gpg: key 6A8DFC40: public key "Launchpad PPA for Canonical CI Engineering" imported
2015-01-08 11:42:44 INFO config-changed gpg: Total number processed: 1
2015-01-08 11:42:44 INFO config-changed gpg: imported: 1 (RSA: 1)
2015-01-08 11:42:50 INFO config-changed OK
2015-01-08 11:42:53 INFO config-changed Hit http://archive.ubuntu.com precise Release.gpg
2015-01-08 11:42:53 INFO config-changed Get:1 http://security.ubuntu.com precise-security Release.gpg [198 B]
2015-01-08 11:42:53 INFO config-changed Get:2 http://ppa.launchpad.net precise Release.gpg [316 B]
2015-01-08 11:42:53 INFO config-changed Get:3 http://ubuntu-cloud.archive.canonical.com pr...

Vincent Ladeuil (vila) wrote :

2015-01-08 12:01:06 Waiting for relation convergence 60s
2015-01-08 12:02:38 The following units had errors:
   unit: ci-airline-ts-django/0: machine: 12 agent-state: error details: hook failed: "pgsql-relation-joined"
2015-01-08 12:02:38 Deployment stopped. run time: 1568.55

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'test_runner/tstrun/testbed.py'
2--- test_runner/tstrun/testbed.py 2014-10-17 12:28:22 +0000
3+++ test_runner/tstrun/testbed.py 2015-01-08 10:31:48 +0000
4@@ -1,6 +1,6 @@
5 #!/usr/bin/env python
6 # Ubuntu CI Engine
7-# Copyright 2014 Canonical Ltd.
8+# Copyright 2014, 2015 Canonical Ltd.
9
10 # This program is free software: you can redistribute it and/or modify it
11 # under the terms of the GNU Affero General Public License version 3, as
12@@ -178,8 +178,19 @@
13 msg = ('Rate limit reached for {},'
14 ' will sleep for {} seconds')
15 self.logger.exception(msg.format(func.__name__, nap_time))
16- time.sleep(nap_time)
17- return func(*args, **kwargs) # Retry once
18+ except:
19+ # All other exceptions are raised
20+ self.logger.exception('{} failed'.format(func.__name__))
21+ raise TestBedException('{} failed'.format(func.__name__))
22+ try:
23+ time.sleep(nap_time)
24+ return func(*args, **kwargs) # Retry once
25+ except:
26+ # FIXME: This duplicates the two lines above but this method will
27+ # be refactored to retry more than once in the future. The
28+ # duplication can be fixed then -- vila 2015-01-07
29+ self.logger.exception('{} failed'.format(func.__name__))
30+ raise TestBedException('{} failed'.format(func.__name__))
31
32 def flavors_list(self):
33 return self.retry(self.nova.flavors.list)
34
35=== modified file 'test_runner/tstrun/tests/test_testbed.py'
36--- test_runner/tstrun/tests/test_testbed.py 2014-11-04 12:07:12 +0000
37+++ test_runner/tstrun/tests/test_testbed.py 2015-01-08 10:31:48 +0000
38@@ -1,5 +1,5 @@
39 # Ubuntu CI Engine
40-# Copyright 2014 Canonical Ltd.
41+# Copyright 2014, 2015 Canonical Ltd.
42
43 # This program is free software: you can redistribute it and/or modify it
44 # under the terms of the GNU Affero General Public License version 3, as
45@@ -128,9 +128,9 @@
46 # This mimics what will happen when we encounter unknown transient
47 # failures we want to catch: an exception will bubble up and we'll have
48 # to add it to NovaClient.retry().
49- with self.assertRaises(AssertionError) as cm:
50+ with self.assertRaises(testbed.TestBedException) as cm:
51 tb.find_flavor()
52- self.assertEqual('Boom!', unicode(cm.exception))
53+ self.assertEqual('fail failed', '{}'.format(cm.exception))
54
55
56 @features.requires(features.nova_creds)

Subscribers

People subscribed via source and target branches