fix: pytest warnings (#3497)

* fix truncating the timeout red dots on CI failures
* fix deprecated use of with timeout warnings
* remove @pytest.mark.dbg_only as it doesn't exist
---------

Signed-off-by: kostas <kostas@dragonflydb.io>
This commit is contained in:
Kostas Kyrimis 2024-08-13 16:05:15 +03:00 committed by GitHub
parent c756023332
commit d37c2ec85a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 4 deletions

View file

@ -41,6 +41,8 @@ runs:
# timeout returns 124 if we exceeded the timeout duration
if [[ $code -eq 124 ]]; then
# Add an extra new line here because when tests timeout the first line below continues from the test failure name
echo "\n"
echo "🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑"
echo "🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 TESTS TIMEDOUT 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑"
echo "🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑 🛑"

View file

@ -47,7 +47,6 @@ def test_basic(memcached_client: MCClient):
# Noreply (and pipeline) tests
@pytest.mark.dbg_only
@dfly_args(DEFAULT_ARGS)
def test_noreply_pipeline(df_server: DflyInstance, memcached_client: MCClient):
"""

View file

@ -3,7 +3,7 @@ import logging
import os
import glob
import asyncio
import async_timeout
from async_timeout import timeout
import redis
from redis import asyncio as aioredis
from pathlib import Path
@ -169,7 +169,7 @@ async def test_cron_snapshot(tmp_dir: Path, async_client: aioredis.Redis):
await StaticSeeder(**LIGHTWEIGHT_SEEDER_ARGS).run(async_client)
file = None
with async_timeout.timeout(65):
async with timeout(65):
while file is None:
await asyncio.sleep(1)
file = find_main_file(tmp_dir, "test-cron-summary.dfs")
@ -185,7 +185,7 @@ async def test_set_cron_snapshot(tmp_dir: Path, async_client: aioredis.Redis):
await async_client.config_set("snapshot_cron", "* * * * *")
file = None
with async_timeout.timeout(65):
async with timeout(65):
while file is None:
await asyncio.sleep(1)
file = find_main_file(tmp_dir, "test-cron-set-summary.dfs")