Skip to content

Commit

Permalink
repro benoitc#3213
Browse files Browse the repository at this point in the history
  • Loading branch information
pajod committed May 22, 2024
1 parent 9802e21 commit c44589c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 36 deletions.
28 changes: 0 additions & 28 deletions .github/workflows/lint.yml

This file was deleted.

20 changes: 12 additions & 8 deletions .github/workflows/tox.yml → .github/workflows/repro.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tox
name: bug reproducer
on: [push, pull_request]
permissions:
contents: read # to fetch code (actions/checkout)
Expand All @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest] # All OSes pass except Windows because tests need Unix-only fcntl, grp, pwd, etc.
os: [ubuntu-latest]
python-version:
# CPython <= 3.7 is EoL since 2023-06-27
- "3.7"
Expand All @@ -23,9 +23,10 @@ jobs:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
# PyPy <= 3.8 is EoL since 2023-06-16
- "pypy-3.9"
- "pypy-3.10"
# - "pypy-3.9"
# - "pypy-3.10"
steps:
- uses: actions/checkout@v4
- name: Using Python ${{ matrix.python-version }}
Expand All @@ -35,10 +36,13 @@ jobs:
cache: pip
cache-dependency-path: requirements_test.txt
check-latest: true
allow-prereleases: true
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- run: tox -e run-module
- run: tox -e run-entrypoint
- run: tox -e py
python -m pip install qdrant-client
python -m pip install .
- run: |
gunicorn -w 2 -b [::1]:8001 repro-3213:app --enable-stdio-inheritance &
curl http://[::1]:8001/
killall gunicorn
27 changes: 27 additions & 0 deletions repro-3213.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import sys
import os
import logging

if sys.version_info >= (3, 8):
logging.basicConfig(force=True)
logger = logging.getLogger(__name__)
logger.info("logger has been reset")
else:
logging.basicConfig()
logger = logging.getLogger(__name__)

from qdrant_client import QdrantClient
client = QdrantClient(url="https://test.cloud.qdrant.io.invalid:6333", api_key="1")

def app(environ_, start_response):
info = "stderr from app platform=%r %r user=%r:%r:%r pid=%r" % (sys.platform, os.uname(), os.getuid(), os.getgid(), os.getgroups(), os.getpid())
print(info, file=sys.stderr)
# needed for Python <= 3.8
sys.stderr.flush()
body = b"response body from app\n%s\n" % (info.encode(), )
response_head = [
("Content-Type", "text/plain; encoding=utf-8"),
("Content-Length", "%d" % len(body)),
]
start_response("200 OK", response_head)
return iter([body])

0 comments on commit c44589c

Please sign in to comment.