Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
cb2154bf
Commit
cb2154bf
authored
Jul 26, 2019
by
Markus Scheidgen
Browse files
Fixed bad upload proc join code, again. This time with test.
parent
c6e4ce75
Pipeline
#52518
passed with stages
in 17 minutes and 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/processing/data.py
View file @
cb2154bf
...
...
@@ -808,9 +808,9 @@ class Upload(Proc):
# check the join condition, i.e. all calcs have been processed
if
not
self
.
process_running
and
processed_calcs
>=
total_calcs
:
# this can easily be called multiple times, e.g. upload finished after all calcs finished
modified_upload
=
self
.
_get_collection
().
update
(
dict
(
_id
=
self
.
upload_id
,
joined
__ne
=
True
)
,
{
'$set'
:
{
'joined'
:
True
}}
,
upsert
=
False
)
modified_upload
=
self
.
_get_collection
().
find_one_and_
update
(
{
'_id'
:
self
.
upload_id
,
'
joined
'
:
{
'$ne'
:
True
}}
,
{
'$set'
:
{
'joined'
:
True
}})
if
modified_upload
is
not
None
:
self
.
get_logger
().
debug
(
'join'
)
self
.
cleanup
()
...
...
tests/processing/test_data.py
View file @
cb2154bf
...
...
@@ -71,6 +71,7 @@ def assert_processing(upload: Upload, published: bool = False):
assert
upload
.
upload_id
is
not
None
assert
len
(
upload
.
errors
)
==
0
assert
upload
.
tasks_status
==
SUCCESS
assert
upload
.
joined
upload_files
=
UploadFiles
.
get
(
upload
.
upload_id
,
is_authorized
=
lambda
:
True
)
if
published
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment