#4644 tests: a try except block on tearDown to prevent failing tests due to directory removing race conditions
Merged 4 years ago by pingou. Opened 4 years ago by jlanda.
jlanda/pagure fix-test-race-condition  into  master

@@ -434,9 +434,6 @@ 

      @patch("pagure.cli.admin._ask_confirmation")

      def test_do_expire_admin_token(self, conf, rinp):

          """ Test the do_expire_admin_token function of pagure-admin. """

-         if "BUILD_ID" in os.environ:

-             raise unittest.case.SkipTest("Skipping on jenkins/el7")

- 

          # Create an admin token to use

          conf.return_value = True

          rinp.return_value = "1,2,3"
@@ -504,8 +501,6 @@ 

      def test_do_expire_admin_token_non_admin_acls(self, conf, rinp):

          """ Test the do_expire_admin_token function of pagure-admin for a token

          without any admin ACL. """

-         if "BUILD_ID" in os.environ:

-             raise unittest.case.SkipTest("Skipping on jenkins/el7")

  

          # Create an admin token to use

          conf.return_value = True
@@ -561,8 +556,6 @@ 

      def test_do_update_admin_token_invalid_date(self, conf, rinp):

          """ Test the do_update_admin_token function of pagure-admin with

          an invalid date. """

-         if "BUILD_ID" in os.environ:

-             raise unittest.case.SkipTest("Skipping on jenkins/el7")

  

          # Create an admin token to use

          conf.return_value = True
@@ -604,8 +597,6 @@ 

      def test_do_update_admin_token_invalid_date2(self, conf, rinp):

          """ Test the do_update_admin_token function of pagure-admin with

          an invalid date. """

-         if "BUILD_ID" in os.environ:

-             raise unittest.case.SkipTest("Skipping on jenkins/el7")

  

          # Create an admin token to use

          conf.return_value = True
@@ -649,8 +640,6 @@ 

      def test_do_update_admin_token_invalid_date3(self, conf, rinp):

          """ Test the do_update_admin_token function of pagure-admin with

          an invalid date (is today). """

-         if "BUILD_ID" in os.environ:

-             raise unittest.case.SkipTest("Skipping on jenkins/el7")

  

          # Create an admin token to use

          conf.return_value = True
@@ -697,8 +686,6 @@ 

      @patch("pagure.cli.admin._ask_confirmation")

      def test_do_update_admin_token(self, conf, rinp):

          """ Test the do_update_admin_token function of pagure-admin. """

-         if "BUILD_ID" in os.environ:

-             raise unittest.case.SkipTest("Skipping on jenkins/el7")

  

          # Create an admin token to use

          conf.return_value = True
@@ -781,8 +768,6 @@ 

      def test_do_update_admin_token_non_admin_acls(self, conf, rinp):

          """ Test the do_update_admin_token function of pagure-admin for a token

          without any admin ACL. """

-         if "BUILD_ID" in os.environ:

-             raise unittest.case.SkipTest("Skipping on jenkins/el7")

  

          # Create an admin token to use

          conf.return_value = True

@@ -97,8 +97,11 @@ 

          )

  

      def tearDown(self):

+         try:

+             tests.clean_pull_requests_path()

+         except:

+             pass

          super(PagureFlaskPrEdittests, self).tearDown()

-         tests.clean_pull_requests_path()

  

      def test_pr_edit_pull_request_unauthenticated(self):

          output = self.app.get("/test/pull-request/1/edit")

let's try removing conditional bypass...

rebased onto 902dcfc

4 years ago

pretty please pagure-ci rebuild

4 years ago

2 new commits added

  • test_pagure_admin: remove conditional test skipping
  • tests: a try except block on tearDown to prevent failing tests due to directory removing race conditions
4 years ago

pretty please pagure-ci rebuild

4 years ago

pretty please pagure-ci rebuild

4 years ago

jenkin's 2909 fails are not related to this PR but to the pipeline

pretty please pagure-ci rebuild

4 years ago

5/5 success jobs with this. I feel quite confident with it :)

pretty please pagure-ci rebuild

4 years ago

pretty please pagure-ci rebuild

4 years ago

pretty please pagure-ci rebuild

4 years ago

pretty please pagure-ci rebuild

4 years ago

pretty please pagure-ci rebuild

4 years ago

Pull-Request has been merged by pingou

4 years ago