From 084f6fce77d037eaef30a7d922683d9293e6f995 Mon Sep 17 00:00:00 2001 From: FredBill1 <36622430+FredBill1@users.noreply.github.com> Date: Thu, 15 Feb 2024 22:51:56 +0000 Subject: [PATCH] fix #18388 by manually del runtime_model in python code --- .../python/tests/test_runtime/test_compiled_model.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bindings/python/tests/test_runtime/test_compiled_model.py b/src/bindings/python/tests/test_runtime/test_compiled_model.py index b86b061dc973f3..dc9b19e69927d7 100644 --- a/src/bindings/python/tests/test_runtime/test_compiled_model.py +++ b/src/bindings/python/tests/test_runtime/test_compiled_model.py @@ -2,6 +2,8 @@ # Copyright (C) 2018-2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 +import gc + import pytest import numpy as np @@ -27,6 +29,9 @@ def test_get_runtime_model(device): compiled_model = generate_relu_compiled_model(device) runtime_model = compiled_model.get_runtime_model() assert isinstance(runtime_model, Model) + # make sure runtime_model is destroyed before the dynamic library is unloaded, as described in issue #18388 + del runtime_model + gc.collect() def test_export_import(device):