Skip to content

Commit 069ebaf

Browse files
lukebaumanncopybara-github
authored andcommitted
Small test change
PiperOrigin-RevId: 752387212
1 parent bd8fdc2 commit 069ebaf

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

pathwaysutils/test/profiling_test.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ def setUp(self):
3232

3333
@parameterized.parameters(8000, 1234)
3434
def test_collect_profile_port(self, port):
35-
profiling.collect_profile(
35+
result = profiling.collect_profile(
3636
port=port,
3737
duration_ms=1000,
3838
host="127.0.0.1",
3939
log_dir="gs://test_bucket/test_dir",
4040
)
4141

42+
self.assertTrue(result)
4243
self.mock_post.assert_called_once_with(
4344
f"http://127.0.0.1:{port}/profiling",
4445
json={
@@ -49,13 +50,14 @@ def test_collect_profile_port(self, port):
4950

5051
@parameterized.parameters(1000, 1234)
5152
def test_collect_profile_duration_ms(self, duration_ms):
52-
profiling.collect_profile(
53+
result = profiling.collect_profile(
5354
port=8000,
5455
duration_ms=duration_ms,
5556
host="127.0.0.1",
5657
log_dir="gs://test_bucket/test_dir",
5758
)
5859

60+
self.assertTrue(result)
5961
self.mock_post.assert_called_once_with(
6062
"http://127.0.0.1:8000/profiling",
6163
json={
@@ -66,13 +68,14 @@ def test_collect_profile_duration_ms(self, duration_ms):
6668

6769
@parameterized.parameters("127.0.0.1", "localhost", "192.168.1.1")
6870
def test_collect_profile_host(self, host):
69-
profiling.collect_profile(
71+
result = profiling.collect_profile(
7072
port=8000,
7173
duration_ms=1000,
7274
host=host,
7375
log_dir="gs://test_bucket/test_dir",
7476
)
7577

78+
self.assertTrue(result)
7679
self.mock_post.assert_called_once_with(
7780
f"http://{host}:8000/profiling",
7881
json={
@@ -87,10 +90,11 @@ def test_collect_profile_host(self, host):
8790
"gs://test_bucket3/test/log/dir",
8891
)
8992
def test_collect_profile_log_dir(self, log_dir):
90-
profiling.collect_profile(
93+
result = profiling.collect_profile(
9194
port=8000, duration_ms=1000, host="127.0.0.1", log_dir=log_dir
9295
)
9396

97+
self.assertTrue(result)
9498
self.mock_post.assert_called_once_with(
9599
"http://127.0.0.1:8000/profiling",
96100
json={
@@ -102,7 +106,7 @@ def test_collect_profile_log_dir(self, log_dir):
102106
@parameterized.parameters("/logs/test_log_dir", "relative_path/my_log_dir")
103107
def test_collect_profile_log_dir_error(self, log_dir):
104108
with self.assertRaises(ValueError):
105-
profiling.collect_profile(
109+
result = profiling.collect_profile(
106110
port=8000, duration_ms=1000, host="127.0.0.1", log_dir=log_dir
107111
)
108112

0 commit comments

Comments
 (0)