Skip to content

Commit

Permalink
Merge pull request #94 from lsst-ts/microfix-manager-test
Browse files Browse the repository at this point in the history
Fix test_heartbeat.py
  • Loading branch information
sebastian-aranda authored Jan 29, 2021
2 parents 1105b6c + f83cb1b commit 1ae0872
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit 1ae0872

Please sign in to comment.