Merge lp:~bac/charmworld/timeout-values into lp:~juju-jitsu/charmworld/trunk

Proposed by Brad Crittenden
Status: Merged
Approved by: Brad Crittenden
Approved revision: 381
Merged at revision: 380
Proposed branch: lp:~bac/charmworld/timeout-values
Merge into: lp:~juju-jitsu/charmworld/trunk
Diff against target: 55 lines (+8/-3)
3 files modified
charmworld/search.py (+1/-1)
charmworld/tests/test_search.py (+2/-2)
charmworld/views/tests/test_auth.py (+5/-0)
To merge this branch: bzr merge lp:~bac/charmworld/timeout-values
Reviewer Review Type Date Requested Status
Benji York (community) Approve
Review via email: mp+183877@code.launchpad.net

Commit message

Change timeout units for calls to ElasticSearch 'health' to match documentation. Also silence openid messages.

Description of the change

For health queries it *appears* that ES wants a string representing the timeout value with a unit, i.e. '30s' rather than an integer specifying the number of milliseconds.

See the 'health' entry at http://pyelasticsearch.readthedocs.org/en/latest/api/#module-pyelasticsearch
and follow the link below it to the native ES documentation.

This branch also silences openid messages spewed during testing.

To post a comment you must log in.
lp:~bac/charmworld/timeout-values updated
381. By Brad Crittenden

Merge from trunk

Revision history for this message
Benji York (benji) wrote :

Looks good. I agree with your reading of the timeout docs.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmworld/search.py'
2--- charmworld/search.py 2013-09-04 10:26:28 +0000
3+++ charmworld/search.py 2013-09-04 13:38:23 +0000
4@@ -121,7 +121,7 @@
5 def __init__(self, client, index_name):
6 self._client = client
7 self.index_name = index_name
8- self.stable_status_timeout = 30000
9+ self.stable_status_timeout = '30s'
10
11 def exists(self):
12 try:
13
14=== modified file 'charmworld/tests/test_search.py'
15--- charmworld/tests/test_search.py 2013-09-04 13:17:21 +0000
16+++ charmworld/tests/test_search.py 2013-09-04 13:38:23 +0000
17@@ -721,7 +721,7 @@
18 def test_put_mapping_missing_index(self):
19 # The error we get from a missing index is IndexMissing
20 client = ElasticSearchClient.from_settings(get_ini(), 'temp-index')
21- client.stable_status_timeout = 500
22+ client.stable_status_timeout = '0.5s'
23 with self.assertRaises(IndexMissing):
24 client.put_mapping()
25
26@@ -993,7 +993,7 @@
27 def test_update_no_index(self):
28 index_client = ElasticSearchClient.from_settings(
29 get_ini(), 'temp-index')
30- index_client.stable_status_timeout = 500
31+ index_client.stable_status_timeout = '0.5s'
32 actual_client = update(index_client)
33 self.addCleanup(actual_client.delete_index)
34 self.assertEqual([actual_client.index_name],
35
36=== modified file 'charmworld/views/tests/test_auth.py'
37--- charmworld/views/tests/test_auth.py 2013-09-03 20:22:22 +0000
38+++ charmworld/views/tests/test_auth.py 2013-09-04 13:38:23 +0000
39@@ -1,11 +1,16 @@
40 # Copyright 2012, 2013 Canonical Ltd. This software is licensed under the
41 # GNU Affero General Public License version 3 (see the file LICENSE).
42
43+import openid.oidutil
44+
45 from charmworld.testing import factory
46 from charmworld.testing import login_request
47 from charmworld.testing import WebTestBase
48
49
50+openid.oidutil.log = lambda message, level=0: None
51+
52+
53 class TestAuthViews(WebTestBase):
54
55 def test_post_auth(self):

Subscribers

People subscribed via source and target branches