Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
soledad
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drebs
soledad
Commits
17b4ab3d
There was a problem fetching the pipeline summary.
Unverified
Commit
17b4ab3d
authored
Oct 27, 2017
by
Victor
Committed by
drebs
Oct 31, 2017
Browse files
Options
Downloads
Patches
Plain Diff
[bug] set errbacks before gathering results
parent
3306ea69
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/leap/soledad/common/couch/state.py
+2
-3
2 additions, 3 deletions
src/leap/soledad/common/couch/state.py
tests/couch/test_state.py
+2
-2
2 additions, 2 deletions
tests/couch/test_state.py
with
4 additions
and
5 deletions
src/leap/soledad/common/couch/state.py
+
2
−
3
View file @
17b4ab3d
...
@@ -93,9 +93,8 @@ def _check_db_schema_version(url, db, auth, agent=None):
...
@@ -93,9 +93,8 @@ def _check_db_schema_version(url, db, auth, agent=None):
def
_stop
(
failure
,
reactor
):
def
_stop
(
failure
,
reactor
):
exception
=
failure
.
value
.
subFailure
.
value
logger
.
error
(
"
Failure while checking schema versions: %r - %s
"
logger
.
error
(
"
Failure while checking schema versions: %r - %s
"
%
(
exception
,
exception
.
message
))
%
(
failure
,
failure
.
message
))
reactor
.
addSystemEventTrigger
(
'
after
'
,
'
shutdown
'
,
os
.
_exit
,
1
)
reactor
.
addSystemEventTrigger
(
'
after
'
,
'
shutdown
'
,
os
.
_exit
,
1
)
reactor
.
stop
()
reactor
.
stop
()
...
@@ -124,9 +123,9 @@ def check_schema_versions(couch_url, agent=None, reactor=reactor):
...
@@ -124,9 +123,9 @@ def check_schema_versions(couch_url, agent=None, reactor=reactor):
if
not
db
.
startswith
(
'
user-
'
):
if
not
db
.
startswith
(
'
user-
'
):
continue
continue
d
=
semaphore
.
run
(
_check_db_schema_version
,
url
,
db
,
auth
,
agent
=
agent
)
d
=
semaphore
.
run
(
_check_db_schema_version
,
url
,
db
,
auth
,
agent
=
agent
)
d
.
addErrback
(
_stop
,
reactor
=
reactor
)
deferreds
.
append
(
d
)
deferreds
.
append
(
d
)
d
=
defer
.
gatherResults
(
deferreds
,
consumeErrors
=
True
)
d
=
defer
.
gatherResults
(
deferreds
,
consumeErrors
=
True
)
d
.
addErrback
(
_stop
,
reactor
=
reactor
)
yield
d
yield
d
...
...
This diff is collapsed.
Click to expand it.
tests/couch/test_state.py
+
2
−
2
View file @
17b4ab3d
...
@@ -47,7 +47,7 @@ class CouchDesignDocsTests(CouchDBTestCase):
...
@@ -47,7 +47,7 @@ class CouchDesignDocsTests(CouchDBTestCase):
mocked_reactor
=
mock
.
Mock
()
mocked_reactor
=
mock
.
Mock
()
yield
check_schema_versions
(
yield
check_schema_versions
(
self
.
couch_url
,
agent
=
self
.
agent
,
reactor
=
mocked_reactor
)
self
.
couch_url
,
agent
=
self
.
agent
,
reactor
=
mocked_reactor
)
self
.
assertTrue
(
mocked_reactor
.
stop
.
call_count
==
1
)
mocked_reactor
.
stop
.
assert_called
(
)
@defer.inlineCallbacks
@defer.inlineCallbacks
def
test__check_db_schema_version_missing_config_doc_raises
(
self
):
def
test__check_db_schema_version_missing_config_doc_raises
(
self
):
...
@@ -62,4 +62,4 @@ class CouchDesignDocsTests(CouchDBTestCase):
...
@@ -62,4 +62,4 @@ class CouchDesignDocsTests(CouchDBTestCase):
mocked_reactor
=
mock
.
Mock
()
mocked_reactor
=
mock
.
Mock
()
yield
check_schema_versions
(
yield
check_schema_versions
(
self
.
couch_url
,
agent
=
self
.
agent
,
reactor
=
mocked_reactor
)
self
.
couch_url
,
agent
=
self
.
agent
,
reactor
=
mocked_reactor
)
self
.
assertTrue
(
mocked_reactor
.
stop
.
call_count
==
1
)
mocked_reactor
.
stop
.
assert_called
(
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment