Fixed potential issue with custom filters 42/308742/1
authorPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Fri, 29 Mar 2024 10:35:45 +0000 (11:35 +0100)
committerPiotr Kosko/Tizen API (PLT) /SRPOL/Engineer/Samsung Electronics <p.kosko@samsung.com>
Fri, 29 Mar 2024 10:40:19 +0000 (11:40 +0100)
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 <p.kosko@samsung.com>
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_errorCallback_invoked.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_registerCustomFilter_with_errorCallback.html
common/tct-mlpipeline-tizen-tests/mlpipeline/MachineLearningPipeline_unregisterCustomFilter_InvalidStateError.html

index 6f052047719aa43e1b6550163ff3b728fd236a79..e37ecdac26f73a0871ba1357eb8ef6994f9b7bb6 100755 (executable)
@@ -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 " +
index 4e8be8684c341f1aedfc8465040610e403f0ae8d..a54e81068a96f7d33d55470fb484756571aa3879 100755 (executable)
@@ -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 " +
index 7ba8eec06854ab2b4aad160904f7113b9525c917..5bf820223bac97caffc5a8a6b03c945356c47140 100755 (executable)
@@ -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 " +
index 7cb6ae40149e816aa391f3a9e06412748fee6e83..d894b087722195f5ad244b878742a72cc5c49877 100755 (executable)
@@ -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 " +