Skip to content

Commit 23da13b

Browse files
committed
remove redundant ci tests, use connection pool adapter
1 parent c759357 commit 23da13b

File tree

3 files changed

+7
-31
lines changed

3 files changed

+7
-31
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,8 @@ on:
66

77
jobs:
88
test:
9-
runs-on: ubuntu-latest
10-
strategy:
11-
matrix:
12-
python-version: ["3.11", "3.12"]
13-
14-
env:
15-
BIGTABLE_EMULATOR_HOST: localhost:8086
16-
17-
steps:
18-
- uses: actions/checkout@v4
19-
20-
- name: Start BigTable emulator
21-
run: |
22-
docker run -d -p 8086:8086 --name bigtable-emulator \
23-
gcr.io/google.com/cloudsdktool/google-cloud-cli:emulators \
24-
gcloud beta emulators bigtable start --host-port=0.0.0.0:8086
25-
timeout 30 bash -c 'until nc -z localhost 8086; do sleep 1; done'
26-
27-
- name: Set up Python ${{ matrix.python-version }}
28-
uses: actions/setup-python@v5
29-
with:
30-
python-version: ${{ matrix.python-version }}
31-
32-
- name: Install dependencies
33-
run: |
34-
python -m pip install --upgrade pip
35-
pip install pytest pytest-cov
36-
pip install -e .
37-
38-
- name: Run tests with coverage
39-
run: pytest --cov=kvdbclient --cov-report=xml tests/
9+
uses: ./.github/workflows/test.yml
10+
secrets: inherit
4011

4112
publish:
4213
needs: test

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches: [main]
66
pull_request:
77
branches: [main]
8+
workflow_call:
89

910
jobs:
1011
test:

kvdbclient/hbase/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import numpy as np
1111
import requests
12+
from requests.adapters import HTTPAdapter
1213
from tenacity import retry, stop_after_attempt, wait_exponential, retry_if_exception_type
1314

1415
from . import HBaseConfig
@@ -90,6 +91,9 @@ def __init__(
9091
self._base_url = config.BASE_URL.rstrip("/")
9192
self._table_id = table_id
9293
self._session = requests.Session()
94+
adapter = HTTPAdapter(pool_connections=1, pool_maxsize=32)
95+
self._session.mount("http://", adapter)
96+
self._session.mount("https://", adapter)
9397
self._session.headers.update({
9498
"Accept": "application/json",
9599
"Content-Type": "application/json",

0 commit comments

Comments
 (0)