Skip to content

Commit

Permalink
Fix memory units.
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Jul 7, 2022
1 parent c67192b commit 803cfeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/integration/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def _factory() -> dict[str, Any]:
"container": {
"image": "ubuntu",
"command": "true",
"resources": {"cpu": 0.1, "memory_mb": 32},
"resources": {"cpu": 0.1, "memory": 32 * 2**20},
}
}

Expand Down
12 changes: 6 additions & 6 deletions tests/integration/test_jobs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ async def test_save_ok(
image_tag: str,
) -> None:
resources = Resources(
memory_mb=32,
memory=32 * 2**20,
cpu=0.1,
gpu=None,
shm=False,
Expand Down Expand Up @@ -191,7 +191,7 @@ async def test_save_no_tag(
image_tag: str,
) -> None:
resources = Resources(
memory_mb=32,
memory=32 * 2**20,
cpu=0.1,
gpu=None,
shm=False,
Expand Down Expand Up @@ -229,7 +229,7 @@ async def test_save_pending_job(
image_tag: str,
) -> None:
resources = Resources(
memory_mb=16**10,
memory=2**60,
cpu=0.1,
gpu=None,
shm=False,
Expand All @@ -255,7 +255,7 @@ async def test_save_push_failure(
image_tag: str,
) -> None:
resources = Resources(
memory_mb=32,
memory=32 * 2**20,
cpu=0.1,
gpu=None,
shm=False,
Expand Down Expand Up @@ -296,7 +296,7 @@ async def test_save_commit_fails_with_exception(
image_tag: str,
) -> None:
resources = Resources(
memory_mb=32,
memory=32 * 2**20,
cpu=0.1,
gpu=None,
shm=False,
Expand Down Expand Up @@ -326,7 +326,7 @@ async def test_mark_logs_dropped(
jobs_service: JobsService,
) -> None:
resources = Resources(
memory_mb=16, cpu=0.1, gpu=None, shm=False, gpu_model=None
memory=16 * 2**20, cpu=0.1, gpu=None, shm=False, gpu_model=None
)
job = await job_factory(
"alpine:latest",
Expand Down

0 comments on commit 803cfeb

Please sign in to comment.