Skip to content

Commit

Permalink
post_live_metrics: Increase timeout (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
daavoo authored May 23, 2023
1 parent d1e1970 commit c513701
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/dvc_studio_client/post_live_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def post_live_metrics( # noqa: C901
"Content-type": "application/json",
"Authorization": f"token {config['token']}",
},
timeout=5,
timeout=(30, 5),
)
except RequestException:
return False
Expand Down
24 changes: 12 additions & 12 deletions tests/test_post_live_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def test_post_live_metrics_start_event(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)

post_live_metrics(
Expand All @@ -211,7 +211,7 @@ def test_post_live_metrics_start_event(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)


Expand Down Expand Up @@ -246,7 +246,7 @@ def test_post_live_metrics_start_event_machine(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)


Expand Down Expand Up @@ -281,7 +281,7 @@ def test_post_live_metrics_data(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)

assert post_live_metrics(
Expand All @@ -307,7 +307,7 @@ def test_post_live_metrics_data(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)

assert post_live_metrics(
Expand Down Expand Up @@ -337,7 +337,7 @@ def test_post_live_metrics_data(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)


Expand Down Expand Up @@ -368,7 +368,7 @@ def test_post_live_metrics_done(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)

assert post_live_metrics(
Expand All @@ -388,7 +388,7 @@ def test_post_live_metrics_done(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)

assert post_live_metrics(
Expand All @@ -412,7 +412,7 @@ def test_post_live_metrics_done(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)


Expand Down Expand Up @@ -480,7 +480,7 @@ def test_post_live_metrics_token_and_repo_url_args(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)


Expand Down Expand Up @@ -515,7 +515,7 @@ def test_post_live_metrics_message(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)

# Test message length limit
Expand All @@ -541,7 +541,7 @@ def test_post_live_metrics_message(mocker, monkeypatch):
"Authorization": "token FOO_TOKEN",
"Content-type": "application/json",
},
timeout=5,
timeout=(30, 5),
)


Expand Down

0 comments on commit c513701

Please sign in to comment.