diff --git a/src/jobflow_remote/testing/__init__.py b/src/jobflow_remote/testing/__init__.py index e3d6362a..048e5005 100644 --- a/src/jobflow_remote/testing/__init__.py +++ b/src/jobflow_remote/testing/__init__.py @@ -43,16 +43,20 @@ def check_env_var() -> str: return os.environ.get("TESTING_ENV_VAR", "unset") -@job(big_files="data") +@job def add_big(a: float, b: float): - """Adds two numbers together and writes the answer to an artificially large file - which is stored in a pre-defined store.""" - import pathlib + """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. + + """ + import array result = a + b - with open("file.txt", "w") as f: - f.writelines([f"{result}"] * int(1e5)) - return Response({"data": pathlib.Path("file.txt"), "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) + return Response({"data": big_array, "result": a + b}) @job(undefined_store="data")