[pitivi] tests: Fixed flaky CompositingPropertiesTest



commit b5226e23138904219682c51afd4132b77ec7221c
Author: Aryan Kaushik <73686-Aryan20 users noreply gitlab gnome org>
Date:   Thu Apr 28 10:13:35 2022 +0000

    tests: Fixed flaky CompositingPropertiesTest

 tests/common.py                          | 5 +++++
 tests/test_clipproperties_compositing.py | 3 ---
 2 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/tests/common.py b/tests/common.py
index 2a1ccb13f..1c9e365db 100644
--- a/tests/common.py
+++ b/tests/common.py
@@ -271,6 +271,11 @@ def setup_project_with_clips(assets_names: List[str]):
         @setup_project(assets_names)
         def wrapper(self):
             assets = self.app.project_manager.current_project.list_assets(GES.UriClip)
+
+            # Insert the assets in the same order that we got them.
+            assets_by_name = {os.path.basename(asset.get_id()): asset for asset in assets}
+            assets = [assets_by_name[name] for name in assets_names]
+
             self.timeline_container.insert_assets(assets, self.timeline.props.duration)
 
             func(self)
diff --git a/tests/test_clipproperties_compositing.py b/tests/test_clipproperties_compositing.py
index 7e9510fdf..8dd73b387 100644
--- a/tests/test_clipproperties_compositing.py
+++ b/tests/test_clipproperties_compositing.py
@@ -18,8 +18,6 @@
 # License along with this program; if not, see <http://www.gnu.org/licenses/>.
 """Tests for the pitivi.clipproperties module."""
 # pylint: disable=protected-access,no-self-use,import-outside-toplevel,no-member
-from unittest import skip
-
 from gi.repository import Gst
 
 from tests import common
@@ -94,7 +92,6 @@ class CompositingPropertiesTest(common.TestCase):
                                           [0, 1, 0.5, 1, 0],
                                           [0, 0.5 * Gst.SECOND, 0.6 * Gst.SECOND, clip.duration - 0.3 * 
Gst.SECOND, clip.duration])
 
-    @skip("flaky")
     @common.setup_project_with_clips(assets_names=["1sec_simpsons_trailer.mp4", 
"30fps_numeroted_frames_blue.webm"])
     @common.setup_clipproperties
     def test_adjustments_updated_when_switching_clips(self):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]