Skip to content

Commit

Permalink
fix engine test bug caused by no-clear between tests (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
wzh1994 authored Nov 20, 2024
1 parent 8035a65 commit 3c1d3a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lazyllm/engine/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def cond(x):
return True
return False

return lazyllm.ifs(cond, tpath=lazyllm.TrainableModule(base_model), fpath=lazyllm.Identity())
return lazyllm.ActionModule(lazyllm.ifs(cond, tpath=lazyllm.TrainableModule(base_model), fpath=lazyllm.Identity()))


@NodeConstructor.register('Constant')
Expand Down
8 changes: 8 additions & 0 deletions tests/advanced_tests/standard_test/test_engine.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import lazyllm
import os
import pytest
from lazyllm.engine import LightEngine

class TestEngine(object):
Expand All @@ -11,6 +12,13 @@ def _test_vqa(self):
engine = LightEngine()
engine.start(node, edge, resource)

@pytest.fixture(autouse=True)
def run_around_tests(self):
yield
LightEngine().reset()
lazyllm.FileSystemQueue().dequeue()
lazyllm.FileSystemQueue(klass="lazy_trace").dequeue()

def test_http(self):
nodes = [
dict(
Expand Down

0 comments on commit 3c1d3a0

Please sign in to comment.