Skip to content

Commit

Permalink
Dial back the size of test data in the GridFS test
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-evs committed Feb 20, 2024
1 parent f770bd7 commit 9073c8c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
12 changes: 4 additions & 8 deletions src/jobflow_remote/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,15 @@ def check_env_var() -> str:
return os.environ.get("TESTING_ENV_VAR", "unset")


@job
@job(big_data="data")
def add_big(a: float, b: float):
"""Adds two numbers together and inflates the answer
to an array too large to store in MongoDB, then tries
to store that within the defined store.
to a large list list and tries to store that within
the defined store.
"""
import array

result = a + b
# create a 1.6 MB array that will be too large to store in MongoDB
# the array type "d" is a double-precision float, which is 8 bytes
big_array = array.array("d", [result] * 200_000)
big_array = [result] * 5_000
return Response({"data": big_array, "result": a + b})


Expand Down
2 changes: 1 addition & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def write_tmp_settings(
"collection_name": "docs",
},
"additional_stores": {
"big_files": {
"big_data": {
"type": "GridFSStore",
"database": store_database_name,
"host": "localhost",
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def test_additional_stores(worker, job_controller):
runner.run(ticks=10)

doc = job_controller.get_jobs({})[0]
fs = job_controller.jobstore.additional_stores["big_files"]
fs = job_controller.jobstore.additional_stores["big_data"]
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
Expand Down

0 comments on commit 9073c8c

Please sign in to comment.