Skip to content

Commit

Permalink
CI: Fixed workflows after changes added in gh-378
Browse files Browse the repository at this point in the history
  • Loading branch information
francis-clairicia committed Nov 11, 2024
1 parent 7087e4a commit 3a92e57
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/actions/freebsd-vm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ runs:
pdm config install.cache true
run: |
set -e
pdm install --frozen-lockfile --global --project=. --no-self --no-default --dev --group=tox
pdm install --verbose --frozen-lockfile --global --project=. --no-self --no-default --dev --group=tox
tox --version
${{ inputs.run }}
2 changes: 1 addition & 1 deletion .github/actions/setup-tox/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ runs:
shell: bash
- name: Install dependencies
run: |
pdm install --frozen-lockfile --global --project=. --no-self --no-default --dev --group=tox
pdm install --verbose --frozen-lockfile --global --project=. --no-self --no-default --dev --group=tox
tox --version
ls -lA
env:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
- '!README.md'
- '.github/**'
- '!.github/actions/setup-tox/**'
- '!.github/actions/pdm.conf'
- '!.github/workflows/build.yml'
- '.vscode/**'
- 'benchmark/**'
Expand All @@ -38,6 +39,7 @@ on:
- '!README.md'
- '.github/**'
- '!.github/actions/setup-tox/**'
- '!.github/actions/pdm.conf'
- '!.github/workflows/build.yml'
- '.vscode/**'
- 'benchmark/**'
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ on:
- 'pyproject.toml'
- 'pdm.lock'
- '.github/actions/setup-tox/**'
- '.github/actions/freebsd-vm/**'
- '.github/actions/pdm.conf'
- '.github/workflows/lint.yml'
push:
branches:
Expand All @@ -36,6 +38,8 @@ on:
- 'pyproject.toml'
- 'pdm.lock'
- '.github/actions/setup-tox/**'
- '.github/actions/freebsd-vm/**'
- '.github/actions/pdm.conf'
- '.github/workflows/lint.yml'

concurrency:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ on:
- 'pdm.lock'
- '.github/codecov.yml'
- '.github/actions/setup-tox/**'
- '.github/actions/freebsd-vm/**'
- '.github/actions/pdm.conf'
- '.github/workflows/test.yml'
push:
branches:
Expand All @@ -40,6 +42,8 @@ on:
- 'pdm.lock'
- '.github/codecov.yml'
- '.github/actions/setup-tox/**'
- '.github/actions/freebsd-vm/**'
- '.github/actions/pdm.conf'
- '.github/workflows/test.yml'

concurrency:
Expand Down Expand Up @@ -124,7 +128,7 @@ jobs:
- python_version: '3.11'
tox_py: py311

name: test (freebsd-14, ${{ matrix.python_version }})
name: test (freebsd-14.1, ${{ matrix.python_version }})
steps:
- uses: actions/checkout@v4
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ async def test____serve____connect____error_raised(
)

@PlatformMarkers.skipif_platform_win32_because("test failures are all too frequent on CI", skip_only_on_ci=True)
@PlatformMarkers.skipif_platform_bsd_because("test failures are all too frequent on CI", skip_only_on_ci=True)
@pytest.mark.parametrize("errno_value", sorted(ACCEPT_CAPACITY_ERRNOS), ids=errno_errorcode.__getitem__)
@pytest.mark.flaky(retries=3, delay=0.1)
async def test____accept____accept_capacity_error(
Expand All @@ -370,9 +371,9 @@ async def test____accept____accept_capacity_error(
mock_tcp_listener_socket.accept.side_effect = OSError(errno_value, os.strerror(errno_value))

# Act
# It retries every 100 ms, so in 975 ms it will retry at 0, 100, ..., 900
# It retries every 100 ms, so in 950 ms it will retry at 0, 100, ..., 900
# = 10 times total
with CancelScope(deadline=asyncio.get_running_loop().time() + 0.975):
with CancelScope(deadline=asyncio.get_running_loop().time() + 0.950):
await listener.raw_accept()

# Assert
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

import pytest

from ......tools import PlatformMarkers
from ....._utils import datagram_addrinfo_list, stream_addrinfo_list

if TYPE_CHECKING:
Expand Down Expand Up @@ -773,6 +774,7 @@ async def test____create_connection____getaddrinfo_return_mismatch(
dns_resolver.mock_sock_connect.assert_not_called()


@PlatformMarkers.skipif_platform_bsd_because("test failures are all too frequent on CI", skip_only_on_ci=True)
@pytest.mark.asyncio
@pytest.mark.parametrize("connection_socktype", [SOCK_STREAM], indirect=True, ids=repr)
@pytest.mark.flaky(retries=3)
Expand Down
5 changes: 3 additions & 2 deletions tests/unit_test/test_async/test_trio_backend/test_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ async def test____serve____convert_trio_ClosedResourceError(
handler.assert_not_awaited()

@PlatformMarkers.skipif_platform_win32_because("test failures are all too frequent on CI", skip_only_on_ci=True)
@PlatformMarkers.skipif_platform_bsd_because("test failures are all too frequent on CI", skip_only_on_ci=True)
@pytest.mark.parametrize("errno_value", sorted(ACCEPT_CAPACITY_ERRNOS), ids=errno.errorcode.__getitem__)
@pytest.mark.flaky(retries=3, delay=0.1)
async def test____accept____accept_capacity_error(
Expand All @@ -678,9 +679,9 @@ async def test____accept____accept_capacity_error(
mock_trio_socket_listener.accept.side_effect = OSError(errno_value, os.strerror(errno_value))

# Act
# It retries every 100 ms, so in 975 ms it will retry at 0, 100, ..., 900
# It retries every 100 ms, so in 950 ms it will retry at 0, 100, ..., 900
# = 10 times total
with trio.CancelScope(deadline=trio.current_time() + 0.975):
with trio.CancelScope(deadline=trio.current_time() + 0.950):
await listener.serve(handler)

# Assert
Expand Down

0 comments on commit 3a92e57

Please sign in to comment.