Skip to content

Commit b0fe535

Browse files
committed
Add processing delay simulation in BenchIoPOperation and update test case for message handling
1 parent 8cec238 commit b0fe535

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/tests/bench/bench_bo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
from iop import BusinessOperation
2+
import time
23

34
class BenchIoPOperation(BusinessOperation):
45

56
my_param = "BenchIoPOperation"
67

78
def on_message(self, request):
8-
self.log_info("BenchIoPOperation received message")
9-
# raise NotImplementedError("BenchIoPOperation is not implemented yet")
9+
time.sleep(0.01) # Simulate some processing delay
1010
return request

src/tests/bench/cls/Bench.Operation.cls

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Method Method(
1111
set pResponse = ##class(Ens.Response).%New()
1212

1313
try{
14+
// Simulate some processing time
15+
hang 0.01
1416
set pResponse = pRequest
1517

1618
}

src/tests/test_bench.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def setup_class(cls):
137137
cls.results = []
138138

139139
def test_bench_iris(self):
140-
_Director.test_component('Python.BenchIoPProcess')
140+
_Director.test_component('Python.BenchIoPProcess', '', 'msg.MyMessage', '{"message":"test"}')
141141

142142
def run_benchmark(self, test_case):
143143
body = "test"

0 commit comments

Comments
 (0)