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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test_heartbeat.py #94

Merged
merged 2 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions manager/subscription/heartbeat_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ async def query_commander(cls):
try:
# query commander
resp = requests.get(heartbeat_url)
timestamp = resp.json()["timestamp"]
# get timestamp
self.set_heartbeat_timestamp("Commander", timestamp)
timestamp = resp.json()['timestamp']
#get timestamp
cls.set_heartbeat_timestamp('Commander', timestamp)
await asyncio.sleep(3)
except Exception as e:
print(e)
Expand Down
2 changes: 1 addition & 1 deletion manager/subscription/tests/test_heartbeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ async def test_unauthorized_commander(self, mock_requests):
assert response["data"][0]["data"]["timestamp"] is not None

# Act 2 (Wait for query to commander)
# await asyncio.sleep(3)
response = await communicator.receive_json_from(timeout=5)

# Assert 2 (Get producer heartbeat data)
heartbeat_sources = [source["csc"] for source in response["data"]]
assert "Commander" in heartbeat_sources
Expand Down