Skip to content

Commit

Permalink
retighten timings
Browse files Browse the repository at this point in the history
  • Loading branch information
siyangqiu committed Apr 4, 2024
1 parent ba4ec6d commit 709e81e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_session(self, mock_req):

# We should have 1 requests (session start).
assert len(mock_req.request_history) == 1
time.sleep(2)
time.sleep(0.15)

# We should have 2 requests (session and 2 events combined into 1)
print(mock_req.last_request.json())
Expand All @@ -39,7 +39,7 @@ def test_session(self, mock_req):

end_state = 'Success'
agentops.end_session(end_state)
time.sleep(0.2)
time.sleep(0.15)

# We should have 3 requests (additional end session)
assert len(mock_req.request_history) == 3
Expand All @@ -55,7 +55,7 @@ def test_tags(self, mock_req):

# Act
agentops.record(ActionEvent(self.event_type))
time.sleep(0.2)
time.sleep(0.15)

# Assert 2 requests - 1 for session init, 1 for event
print(mock_req.last_request.json())
Expand All @@ -67,7 +67,7 @@ def test_tags(self, mock_req):
# Act
end_state = 'Success'
agentops.end_session(end_state)
time.sleep(0.5)
time.sleep(0.15)

# Assert 3 requets, 1 for session init, 1 for event, 1 for end session
assert len(mock_req.request_history) == 3
Expand Down

0 comments on commit 709e81e

Please sign in to comment.