Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-64358

Flaky ConfigurablePageObject.save() sometimes still on /configSubmit

      When using Folder PageObject, I can see sometimes the save() failing, for example by doing:

      import org.jenkinsci.test.acceptance.po.Folder;
      import org.jenkinsci.test.acceptance.po.Jenkins;
      ...
      Folder folderInController = jenkins.jobs.create(Folder.class, "ControllerFolder");
      folderInController.save();
      

      The expect driver url should ends with /job/ControllerFolder/, but is sometimes ending with /job/ControllerFolder/configSubmit and failing.

          [JENKINS-64358] Flaky ConfigurablePageObject.save() sometimes still on /configSubmit

          James Nord added a comment -

          we are waiting for the current `save` button to become stale, and if Jenkins is slow enough and maven tests are quick enough that will happen as soon as we get the response from Jenkins.
          in this case it is a 302 redirect so we really need a way to know either what the submit endpoint is (so we keep waiting as long as that is the driver.currenturl) or the expected endpoint so we know to wait until the driver.currenturl is the expected page.

          the first would have some issues when saving a form ends up with the same URL as the form submission (by using some form of view in the Jenkins / plugin code).

          James Nord added a comment - we are waiting for the current `save` button to become stale, and if Jenkins is slow enough and maven tests are quick enough that will happen as soon as we get the response from Jenkins. in this case it is a 302 redirect so we really need a way to know either what the submit endpoint is (so we keep waiting as long as that is the driver.currenturl) or the expected endpoint so we know to wait until the driver.currenturl is the expected page. the first would have some issues when saving a form ends up with the same URL as the form submission (by using some form of view in the Jenkins / plugin code).

          Ulli Hafner added a comment -

          The line

          waitFor(e).until(CapybaraPortingLayerImpl::isStale);
          

          breaks my UI tests for Jenkins 2.263.x (it works with Jenkins 2.249.x):

          Ulli Hafner added a comment - The line waitFor(e).until(CapybaraPortingLayerImpl::isStale); breaks my UI tests for Jenkins 2.263.x (it works with Jenkins 2.249.x): https://github.com/jenkinsci/warnings-ng-plugin/pull/758 https://github.com/jenkinsci/git-forensics-plugin/pull/210

            Unassigned Unassigned
            ajard A. Jard
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: