Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix flakiness of test_write_data #7513

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import asyncio
import json
import logging
from asyncio import CancelledError, Event, create_task
from contextlib import suppress
from unittest.mock import AsyncMock, MagicMock, Mock, patch

import pytest
from _pytest.logging import LogCaptureFixture
from aiohttp import ClientSession

from tribler.core import notifications
Expand Down Expand Up @@ -198,7 +196,7 @@ async def test_should_skip_message(events_endpoint):
assert events_endpoint.should_skip_message(message)


async def test_write_data(events_endpoint: EventsEndpoint, caplog: LogCaptureFixture):
async def test_write_data(events_endpoint: EventsEndpoint):
# Test that write_data will call write methods for all responses, even if some of them could raise
# a ConnectionResetError exception.

Expand All @@ -210,5 +208,3 @@ async def test_write_data(events_endpoint: EventsEndpoint, caplog: LogCaptureFix

assert bad_response.write.called
assert good_response.write.called
last_log_record = caplog.records[-1]
assert last_log_record.levelno == logging.WARNING