Skip to content

Commit 3af804d

Browse files
committed
invalid caches when creating new native modules from tests
1 parent d75ba0f commit 3af804d

File tree

1 file changed

+6
-0
lines changed
  • graalpython/com.oracle.graal.python.test/src/tests/cpyext

1 file changed

+6
-0
lines changed

graalpython/com.oracle.graal.python.test/src/tests/cpyext/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
# SOFTWARE.
3939

4040
import sys
41+
from importlib import invalidate_caches
4142
from string import Formatter
4243
os = sys.modules.get("posix", sys.modules.get("nt", None))
4344
if os is None:
@@ -87,6 +88,11 @@ def ccompile(self, name):
8788
binary_file_llvm = '%s/%s.bc' % (__dir__, name)
8889
if GRAALPYTHON:
8990
file_not_empty(binary_file_llvm)
91+
# IMPORTANT:
92+
# Invalidate caches after creating the native module.
93+
# FileFinder caches directory contents, and the check for directory
94+
# changes has whole-second precision, so it can miss quick updates.
95+
invalidate_caches()
9096

9197

9298
def file_not_empty(path):

0 commit comments

Comments
 (0)