Unverified Commit 8f093fb7 authored by Yih-Dar's avatar Yih-Dar Committed by GitHub
Browse files

Avoid OOM in doctest CI (#24139)



* fix

* fix

---------
Co-authored-by: default avatarydshieh <ydshieh@users.noreply.github.com>
parent 0d217f42
......@@ -1870,9 +1870,18 @@ def preprocess_string(string, skip_cuda_tests):
):
is_cuda_found = True
break
modified_string = ""
if not is_cuda_found:
modified_string = "".join(codeblocks)
if ">>>" in modified_string:
lines = modified_string.split("\n")
indent = len(lines[-1]) - len(lines[-1].lstrip())
cleanup = ">>> import gc; gc.collect() # doctest: +IGNORE_RESULT"
modified_string += "\n" + " " * indent + cleanup
return modified_string
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment