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

Fixing timeout error #81

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v2
with:
# python-version: ${{ matrix.python-version }}
python-version: "3.10"
python-version: ${{ matrix.python-version }}
# cache: 'pip'
# cache-dependency-path:
- name: Set up environment
Expand Down
6 changes: 4 additions & 2 deletions alab_management/resource_manager/resource_requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ class RequestCanceledError(Exception):

# considering concurrent.futures.TimeoutError and TimeoutError becomes the same
# from Python 3.11. We should determine the base class of this exception.
if isinstance(concurrent.futures.TimeoutError, TimeoutError):
if concurrent.futures.TimeoutError is TimeoutError:
CombinedTimeoutError = TimeoutError
else:

class CombinedTimeoutError(TimeoutError, concurrent.futures.TimeoutError):
class CombinedTimeoutError(
TimeoutError, concurrent.futures.TimeoutError
): # pylint: disable=duplicate-bases
"""
Combined TimeoutError.

Expand Down
20 changes: 20 additions & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import subprocess
import tempfile
from pathlib import Path


def test_init_command():
# Run the command
with tempfile.TemporaryDirectory() as tmpdirname_:
tmpdirname = Path(tmpdirname_)
subprocess.run(
["alabos", "init"], stdout=subprocess.PIPE, check=True, cwd=tmpdirname
)

# Check that the files were created
assert (tmpdirname / "pyproject.toml").exists()
assert (tmpdirname / "alabos_project" / "config.toml").exists()
assert (
tmpdirname / "alabos_project" / "devices" / "default_device.py"
).exists()
assert (tmpdirname / "alabos_project" / "tasks" / "default_task.py").exists()
Loading