Skip to content

Commit 7d14e48

Browse files
authored
Merge pull request #259 from reportportal/develop
Release
2 parents edc516d + c3567f1 commit 7d14e48

File tree

7 files changed

+15
-17
lines changed

7 files changed

+15
-17
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Changelog
22

33
## [Unreleased]
4+
5+
## [5.6.4]
46
### Added
57
- `ErrorPrintingHttpRequest` and `ErrorPrintingAsyncHttpRequest` classes to avoid recursion on ReportPortal logging, by @HardNorth
68
### Removed

reportportal_client/aio/client.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,8 @@ async def finish_launch(
445445
).make()
446446
if not response:
447447
return None
448-
message = await response.message
449448
logger.debug("finish_launch - ID: %s", await await_if_necessary(launch_uuid))
450-
logger.debug("response message: %s", message)
451-
return message
449+
return None
452450

453451
async def update_test_item(
454452
self,

reportportal_client/client.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -771,12 +771,8 @@ def finish_launch(
771771
if not response:
772772
return None
773773
logger.debug("finish_launch - ID: %s", self.__launch_uuid)
774-
logger.debug("response message: %s", response.message)
775-
message = response.message
776-
else:
777-
message = ""
778774
self._log(self._log_batcher.flush())
779-
return message
775+
return None
780776

781777
def update_test_item(
782778
self, item_uuid: str, attributes: Optional[Union[list, dict]] = None, description: Optional[str] = None

reportportal_client/core/rp_requests.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,20 +145,20 @@ def make(self) -> Optional[RPResponse]:
145145

146146

147147
class ErrorPrintingHttpRequest(HttpRequest):
148-
"""This is specific request object which catches any request error and prints it to the "std.err".
148+
"""This is specific request object which catches any request error and prints it to the "sys.stderr".
149149
150150
The object is supposed to be used in logging methods only to prevent infinite recursion of logging, when logging
151151
framework configured to log everything to ReportPortal. In this case if a request to ReportPortal fails, the
152152
failure will be logged to ReportPortal once again and, for example, in case of endpoint configuration error, it
153153
will also fail and will be logged again. So, the recursion will never end.
154154
155-
This class is used to prevent this situation. It catches any request error and prints it to the "std.err".
155+
This class is used to prevent this situation. It catches any request error and prints it to the "sys.stderr".
156156
"""
157157

158158
def make(self) -> Optional[RPResponse]:
159159
"""Make HTTP request to the ReportPortal API.
160160
161-
The method catches any request error and prints it to the "std.err".
161+
The method catches any request error and prints it to the "sys.stderr".
162162
163163
:return: wrapped HTTP response or None in case of failure
164164
"""
@@ -223,20 +223,20 @@ async def make(self) -> Optional[AsyncRPResponse]:
223223

224224

225225
class ErrorPrintingAsyncHttpRequest(AsyncHttpRequest):
226-
"""This is specific request object which catches any request error and prints it to the "std.err".
226+
"""This is specific request object which catches any request error and prints it to the "sys.stderr".
227227
228228
The object is supposed to be used in logging methods only to prevent infinite recursion of logging, when logging
229229
framework configured to log everything to ReportPortal. In this case if a request to ReportPortal fails, the
230230
failure will be logged to ReportPortal once again and, for example, in case of endpoint configuration error, it
231231
will also fail and will be logged again. So, the recursion will never end.
232232
233-
This class is used to prevent this situation. It catches any request error and prints it to the "std.err".
233+
This class is used to prevent this situation. It catches any request error and prints it to the "sys.stderr".
234234
"""
235235

236236
async def make(self) -> Optional[AsyncRPResponse]:
237237
"""Asynchronously make HTTP request to the ReportPortal API.
238238
239-
The method catches any request error and prints it to the "std.err".
239+
The method catches any request error and prints it to the "sys.stderr".
240240
241241
:return: wrapped HTTP response or None in case of failure
242242
"""

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from setuptools import find_packages, setup
66

7-
__version__ = "5.6.4"
7+
__version__ = "5.6.5"
88

99
TYPE_STUBS = ["*.pyi"]
1010

tests/aio/test_aio_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ async def test_finish_launch(aio_client: Client):
646646
attributes = {"attribute_key": "attribute_value", "system": False}
647647

648648
result = await aio_client.finish_launch(launch_uuid, end_time, status=status, attributes=attributes)
649-
assert result == RESPONSE_MESSAGE
649+
assert result is None
650650
session.put.assert_called_once()
651651
call_args = session.put.call_args_list[0]
652652
assert expected_uri == call_args[0][0]
@@ -671,7 +671,7 @@ async def test_finish_launch_default_values(aio_client: Client):
671671
end_time = str(1696921416000)
672672

673673
result = await aio_client.finish_launch(launch_uuid, end_time)
674-
assert result == RESPONSE_MESSAGE
674+
assert result is None
675675
session.put.assert_called_once()
676676
call_args = session.put.call_args_list[0]
677677
assert expected_uri == call_args[0][0]

tests/aio/test_threaded_client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# limitations under the License
1313

1414
import pickle
15+
import time
1516
from unittest import mock
1617

1718
# noinspection PyPackageRequirements
@@ -46,6 +47,7 @@ def test_clone():
4647
async_client = ThreadedRPClient(*args, **kwargs)
4748
task1 = async_client.create_task(__empty_string())
4849
task2 = async_client.create_task(__empty_string())
50+
time.sleep(0.1)
4951
task1.blocking_result()
5052
task2.blocking_result()
5153
async_client._add_current_item(task1)

0 commit comments

Comments
 (0)