Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 fixes unhandled exception when parsing an invalid string #2608

Merged

Conversation

pcrespov
Copy link
Member

@pcrespov pcrespov commented Oct 28, 2021

What do these changes do?

An unhandled exception is causing the director service to respond with 500 every time is requested to list running services services.

The exception displayed ValueError: unconverted data remains: Z and was raised while parsing an invalid string into a datetime.

A new utils with a more robust parse_as_datetime routine was implemented. In case of an invalid string, the function will return a default provided in the arguments.

Related issue/s

None.

How to test

NOTE: needs python 3.6 in place (e.g. use pyenv local )
NOTE: avoid using make install-dev, since it was not adapted properly since this service will be soon removed

make devenv
cd services/director
pip install -e .
pytest tests/unit/test_utils.py

@pcrespov pcrespov requested review from GitHK and removed request for GitHK October 28, 2021 07:46
@pcrespov pcrespov self-assigned this Oct 28, 2021
@pcrespov pcrespov added this to the Anti-PER milestone Oct 28, 2021
@pcrespov pcrespov mentioned this pull request Oct 28, 2021
3 tasks
@codecov
Copy link

codecov bot commented Oct 28, 2021

Codecov Report

Merging #2608 (8e378b5) into master (0446da5) will increase coverage by 0.0%.
The diff coverage is 100.0%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #2608   +/-   ##
======================================
  Coverage    76.9%   77.0%           
======================================
  Files         630     631    +1     
  Lines       24741   24752   +11     
  Branches     2430    2430           
======================================
+ Hits        19043   19071   +28     
+ Misses       5050    5039   -11     
+ Partials      648     642    -6     
Flag Coverage 螖
integrationtests 66.6% <酶> (+<0.1%) 猬嗭笍
unittests 71.5% <100.0%> (+<0.1%) 猬嗭笍

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage 螖
.../director/src/simcore_service_director/producer.py 61.2% <100.0%> (-0.5%) 猬囷笍
...ces/director/src/simcore_service_director/utils.py 100.0% <100.0%> (酶)
...simcore_service_webserver/projects/projects_api.py 84.8% <0.0%> (+0.3%) 猬嗭笍
...ce_webserver/resource_manager/garbage_collector.py 74.3% <0.0%> (+0.8%) 猬嗭笍
...ector_v2/modules/dynamic_sidecar/scheduler/task.py 92.2% <0.0%> (+1.6%) 猬嗭笍
...simcore_service_director_v2/modules/dask_client.py 92.5% <0.0%> (+1.6%) 猬嗭笍
...rvice_dynamic_sidecar/modules/directory_watcher.py 94.4% <0.0%> (+1.8%) 猬嗭笍
...s/dynamic_sidecar/docker_service_specs/settings.py 75.0% <0.0%> (+2.5%) 猬嗭笍
...webserver/computation_comp_tasks_listening_task.py 85.7% <0.0%> (+3.0%) 猬嗭笍

@pcrespov pcrespov changed the title WIP: 馃悰 fixes unhandled exception when parsing invalid string string WIP: 馃悰 fixes unhandled exception when parsing an invalid string Oct 28, 2021
@pcrespov pcrespov force-pushed the bug/str-to-datetime-exception branch from 4339453 to 5e0ed07 Compare October 28, 2021 08:40
@pcrespov pcrespov changed the title WIP: 馃悰 fixes unhandled exception when parsing an invalid string 馃悰 fixes unhandled exception when parsing an invalid string Oct 28, 2021
@pcrespov pcrespov marked this pull request as ready for review October 28, 2021 08:54
@pcrespov pcrespov added a:director issue related with the director service bug buggy, it does not work as expected labels Oct 28, 2021
@pcrespov pcrespov merged commit 6e67a44 into ITISFoundation:master Oct 28, 2021
@pcrespov pcrespov deleted the bug/str-to-datetime-exception branch October 28, 2021 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:director issue related with the director service bug buggy, it does not work as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants