From: Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics
Date: Fri, 29 Mar 2024 10:35:45 +0000 (+0100)
Subject: Fixed potential issue with custom filters
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61afb403f27015065a8c4918429348407aae9883;p=test%2Ftct%2Fweb%2Fapi.git
Fixed potential issue with custom filters
Issue: On PontusM TV there was a problem that pipelines started in one
test are not finished when the test finishes. This causes that during
the next test custom filter cannot be registered/unregistered and hidden error causes tests to block.
This phenomenom is described in documentation -
https://docs.tizen.org/application/web/api/7.0/device_api/mobile/tizen/ml_pipeline.html#MachineLearningPipeline::unregisterCustomFilter
"Remark: CustomFilter can only be unregistered when it is currently not processing data. Stop pipelines using the filter to ensure that condition. Otherwise an InvalidStateError may be thrown"
[Verification] I've executed
MachineLearningPipeline_registerCustomFilter* and MachineLearningPipeline_unregisterCustomFilter*
tests on PontusM TV - http://10.113.138.205/snapshots/VD/Tizen-9.0/MAIN2025-PontusM/main2025-pontusm_20240325.190744/images/PontusM/T-PTMDAKUC/main2025-pontusm_20240325.190744_T-PTMDAKUC.tar.gz
and issues no longer appear.
Change-Id: Idefa8fb4701296e7955d5c3b1ebbf8659043a3eb
Signed-off-by: Piotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics
---
diff --git a/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter.html b/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter.html
index 6f0520477..e37ecdac2 100755
--- a/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter.html
+++ b/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter.html
@@ -46,12 +46,13 @@ t.step(function () {
customFilter = t.step_func(function (input, output) {
assert_type(retValue, "undefined", "Incorrect return type.");
+ pipeline.stop();
t.done();
});
retValue = tizen.ml.pipeline.registerCustomFilter("flattenFilter", customFilter, inputTI, outputTI);
- pipelineDefinition = "videotestsrc num-buffers=3 " +
+ pipelineDefinition = "videotestsrc num-buffers=1 " +
"! video/x-raw,width=20,height=15,format=BGRA " +
"! tensor_converter " +
"! tensor_filter framework=custom-easy model=flattenFilter " +
diff --git a/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_errorCallback_invoked.html b/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_errorCallback_invoked.html
index 4e8be8684..a54e81068 100755
--- a/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_errorCallback_invoked.html
+++ b/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_errorCallback_invoked.html
@@ -47,11 +47,12 @@ t.step(function () {
return 123;
});
errorCB = t.step_func(function (error) {
+ pipeline.stop();
t.done();
});
tizen.ml.pipeline.registerCustomFilter("testfilter", customFilter, inputTI, outputTI, errorCB);
- pipelineDefinition = "videotestsrc num-buffers=3 " +
+ pipelineDefinition = "videotestsrc num-buffers=1 " +
"! video/x-raw,width=20,height=15,format=BGRA " +
"! tensor_converter " +
"! tensor_filter framework=custom-easy model=testfilter " +
diff --git a/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_with_errorCallback.html b/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_with_errorCallback.html
index 7ba8eec06..5bf820223 100755
--- a/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_with_errorCallback.html
+++ b/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_with_errorCallback.html
@@ -45,6 +45,7 @@ t.step(function () {
customFilter = t.step_func(function (input, output) {
assert_type(retValue, "undefined", "Incorrect return type.");
+ pipeline.stop();
t.done();
});
errorCB = t.step_func(function (error) {
@@ -52,7 +53,7 @@ t.step(function () {
});
retValue = tizen.ml.pipeline.registerCustomFilter("flattenFilter", customFilter, inputTI, outputTI, errorCB);
- pipelineDefinition = "videotestsrc num-buffers=3 " +
+ pipelineDefinition = "videotestsrc num-buffers=1 " +
"! video/x-raw,width=20,height=15,format=BGRA " +
"! tensor_converter " +
"! tensor_filter framework=custom-easy model=flattenFilter " +
diff --git a/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_unregisterCustomFilter_InvalidStateError.html b/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_unregisterCustomFilter_InvalidStateError.html
index 7cb6ae401..d894b0877 100755
--- a/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_unregisterCustomFilter_InvalidStateError.html
+++ b/common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_unregisterCustomFilter_InvalidStateError.html
@@ -48,12 +48,13 @@ t.step(function () {
assert_throws({name: 'InvalidStateError'}, function () {
tizen.ml.pipeline.unregisterCustomFilter("flattenFilter");
}, "InvalidStateError should be thrown - filter is processing data.");
+ pipeline.stop();
t.done();
});
tizen.ml.pipeline.registerCustomFilter("flattenFilter", customFilter, inputTI, outputTI);
- pipelineDefinition = "videotestsrc num-buffers=3 " +
+ pipelineDefinition = "videotestsrc num-buffers=1 " +
"! video/x-raw,width=20,height=15,format=BGRA " +
"! tensor_converter " +
"! tensor_filter framework=custom-easy model=flattenFilter " +