opensistemas-hub / osbrain

osBrain - A general-purpose multi-agent system module written in Python
https://osbrain.readthedocs.io/en/stable/
Apache License 2.0
175 stars 43 forks source link

Poller cleanup #338

Closed Peque closed 5 years ago

codecov[bot] commented 5 years ago

Codecov Report

Merging #338 into master will decrease coverage by 0.02%. The diff coverage is 95.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #338      +/-   ##
==========================================
- Coverage   99.26%   99.24%   -0.03%     
==========================================
  Files          26       26              
  Lines        3549     3570      +21     
  Branches      257      259       +2     
==========================================
+ Hits         3523     3543      +20     
- Misses         14       15       +1     
  Partials       12       12
Impacted Files Coverage Δ
osbrain/agent.py 98.18% <100%> (ø) :arrow_up:
osbrain/tests/test_agent.py 99.77% <94.73%> (-0.23%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2ed8aee...f6bd36d. Read the comment docs.

codecov[bot] commented 5 years ago

Codecov Report

Merging #338 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #338      +/-   ##
==========================================
+ Coverage   99.26%   99.27%   +<.01%     
==========================================
  Files          26       26              
  Lines        3548     3573      +25     
  Branches      257      259       +2     
==========================================
+ Hits         3522     3547      +25     
  Misses         14       14              
  Partials       12       12
Impacted Files Coverage Δ
osbrain/tests/test_agent.py 100% <100%> (ø) :arrow_up:
osbrain/agent.py 98.18% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2ec72a2...ccaf03d. Read the comment docs.

Peque commented 5 years ago

@ocaballeror I did not like the old test very much, but I am not against adding another test if required.

The question would be: what would you test? I would not want to test that, after closing a socket and waiting an arbitrary amount of time, the agent is still alive (in particular the arbitrary amount of time). Could you reproduce the error you were getting without that time sleep?

Otherwise, we could simply test assert not agent.has_socket('alias') as we do for bound sockets, but not sure it adds much.

ocaballeror commented 5 years ago

Yes, the test would need to be changed now that we have a new one to test this specific bug.

I'm OK with the has_socket test, I think that should be enough.

Peque commented 5 years ago

@ocaballeror Pushed the little test: 591b8b1fb1f5e422a5d9c33493a7324d8280fff8

If it is okay with you, I will merge this and make a minor release.

Peque commented 5 years ago

@ocaballeror Thanks a lot! New version is already available in PyPI. :blush: