forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "Pyarrow Segfault Regression Test (ray-project#7568)" (r…
…ay-project#7805)" This reverts commit eb61036.
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
""" | ||
This script ensures that various libraries do not conflict with ray by | ||
trying to import both libraries in both orders. | ||
A specific example is that importing ray after pyarrow causes a Segfault. | ||
""" | ||
import subprocess | ||
|
||
TESTED_LIBRARIES = ["pyarrow"] | ||
|
||
|
||
def test_imports(): | ||
def try_imports(library1, library2): | ||
return_info = subprocess.run([ | ||
"python", "-c", "import {}; import {}".format(library1, library2) | ||
]) | ||
if return_info.returncode != 0: | ||
return "Importing {} before {} caused an error".format( | ||
library1, library2) | ||
return "" | ||
|
||
for library in TESTED_LIBRARIES: | ||
assert try_imports("ray", library) == "" | ||
assert try_imports(library, "ray") == "" | ||
|
||
|
||
if __name__ == "__main__": | ||
import sys | ||
import pytest | ||
sys.exit(pytest.main(["-v", __file__])) |