Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Send evt.net.connection only when status changes #4958

Merged
merged 2 commits into from
Dec 3, 2019

Conversation

jiivan
Copy link
Contributor

@jiivan jiivan commented Dec 2, 2019

fixes: #4957

@jiivan jiivan requested a review from etam December 2, 2019 14:31
@codecov
Copy link

codecov bot commented Dec 2, 2019

Codecov Report

Merging #4958 into b0.22 will increase coverage by 0.94%.
The diff coverage is 100%.

@@            Coverage Diff            @@
##           b0.22    #4958      +/-   ##
=========================================
+ Coverage   89.2%   90.15%   +0.94%     
=========================================
  Files        233      233              
  Lines      21773    21780       +7     
=========================================
+ Hits       19423    19636     +213     
+ Misses      2350     2144     -206

Copy link
Contributor

@etam etam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

def test_run(self, logger):
@patch('golem.client.NetworkConnectionPublisherService.poll')
def test_run(self, poll_mock, logger):
poll_mock.return_value = {'random_key': random.random()}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might very rarely fail, because it might produce the same value twice. You can assign an array to side_effect and it will return next value for each call.

Copy link
Contributor Author

@jiivan jiivan Dec 2, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't fail, because service is initialized in .setUp() which uses original .poll() implementation, that returns totally different kind of dict. Also this value is returned only once.

https://github.com/golemfactory/golem/blob/3b92e82da512a7d3af9c8e31fbdf50638630dc1a/golem/client.py#L1329-L1342

@shadeofblue shadeofblue merged commit 269ff43 into b0.22 Dec 3, 2019
@shadeofblue shadeofblue deleted the b0.22-hold_your_net_status branch December 3, 2019 15:56
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants