Skip to content

Commit

Permalink
Read from GridFS store directly
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Feb 18, 2024
1 parent e9d94c4 commit 9b0ec8b
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions tests/integration/test_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ def test_exec_config(worker, job_controller, random_project_name):
"worker",
["test_local_worker", "test_remote_worker"],
)
def test_additional_stores(worker, job_controller, random_project_name):
import gridfs
def test_additional_stores(worker, job_controller):
from jobflow import Flow

from jobflow_remote import submit_flow
Expand All @@ -260,9 +259,12 @@ def test_additional_stores(worker, job_controller, random_project_name):
runner.run(ticks=10)

doc = job_controller.get_jobs({})[0]
fs = gridfs.GridFS(job_controller.jobstore.db, collection="data")
assert fs.exists({"metadata.job_id": doc["job"]["uuid"]})
assert fs.get({"metadata.job_id": doc["job"]["uuid"]}).read() == b"200"

assert job_controller.count_jobs(state=JobState.FAILED) == 1
assert job_controller.count_flows(state=FlowState.FAILED) == 1
fs = job_controller.jobstore.additional_stores["big_files"]
assert fs.count({"job_uuid": doc["job"]["uuid"]}) == 1
assert job_controller.count_jobs(state=JobState.COMPLETED) == 1
assert job_controller.count_flows(state=FlowState.COMPLETED) == 1
assert job_controller.jobstore.get_output(uuid=doc["job"]["uuid"])["result"] == 200
blob_uuid = job_controller.jobstore.get_output(uuid=doc["job"]["uuid"])["data"][
"blob_uuid"
]
assert fs.query({"blob_uuid": blob_uuid})[0]["job_uuid"] == doc["job"]["uuid"]

0 comments on commit 9b0ec8b

Please sign in to comment.