Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AxisTest#submitInvalidAxisValue for plugin BOM #184

Merged
merged 1 commit into from
Dec 19, 2023

Conversation

MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Dec 11, 2023

Fix AxisTest#submitInvalidAxisValue for plugin BOM

jenkinsci/bom#615 describes the problem in more detail.

When the git plugin is loaded along with the matrix project plugin, there are multiple input fields on the job configuration page with the name _.name. The previous code waited until there was at least one input field with the name _.name, but instead it needs to wait for the arrival of an additional input field with the name _.name.

Adds a new setName method that sets the value of the _.name field that was created by this plugin. Previously, it would set the first _.name field. Setting the first _.name field works when running the matrix plugin tests without the git plugin loaded, but fails when the git plugin is loaded.

The combination of waiting for the correct _.name field to appear and setting the value on the correct _.name field allows one of the four tests to pass when the git plugin is loaded. The remaining tests need more investigation to pass when the git plugin is loaded.

Also removes a nearly silent skip of the tests when the input does not appear within the timeout.

Also increases the time between retries so that my fast computer needs only two or three retries. I confirmed on a much slower computer (Intel Core i5-2410M CPU @ 2.30GHz) that even on that slow computer, it found the necessary field in 8 tries or less. The upper bound of 18 tries should be more than enough for all the test environments. The new upper bound on time is 306ms, while the previous upper bound was 300ms. The difference between the two values should not be relevant.

The retry period should not be increased beyond the current ~300ms because one of the tests is using an input form that does not include _.name. That test falls through to the end of the retry period.

Testing done

Confirmed that the tests pass on several different performance Linux computers.

Confirmed that one previously failing test AxisTest#submitInvalidAxisValue now passes even when the git plugin is included as a test dependency.

More work will be needed to fix the other AxisTest failures when the git plugin is loaded.

Submitter checklist

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@MarkEWaite MarkEWaite requested a review from a team as a code owner December 11, 2023 12:45
@MarkEWaite MarkEWaite changed the title Fix AxisTest#submitInvalidAxisValue for PCT / plugin BOM Fix AxisTest#submitInvalidAxisValue for PCT / plugin BOM Dec 11, 2023
jenkinsci/bom#615 describes the problem in
more detail.

When the git plugin is loaded along with the matrix project plugin,
there are multiple input fields on the job configuration page with the
name `_.name`.  The previous code waited until there was at least one
input field with the name `_.name`, but instead it needs to wait for
the arrival of an additional input field with the name `_.name`.

Adds a new `setName` method that sets the value of the `_.name` field
that was created by this plugin.  Previously, it would set the first
`_.name` field.  Setting the first `_.name` field works when running
the matrix plugin tests without the git plugin loaded, but fails when
the git plugin is loaded.

The combination of waiting for the correct `_.name` field to appear and
setting the value on the correct `_.name` field allows oone of the four
tests to pass when the git plugin is loaded.  The remaining tests need
more investigation to pass when the git plugin is loaded.

Also removes a nearly silent skip of the tests when the input does not
appear within the timeout.

Also increases the time between retries so that my fast computer needs
only two or three retries.  I confirmed on a much slower computer
(Intel Core i5-2410M CPU @ 2.30GHz) that even on that slow computer,
it found the necessary field in 8 tries or less.  The upper bound of 18
tries should be more than enough for all the test environments.

The retry period should not be increased beyond the current ~300ms
because one of the tests is using a form that does not include `_.name`.
That test falls through to the end of the retry period.
@MarkEWaite MarkEWaite changed the title Fix AxisTest#submitInvalidAxisValue for PCT / plugin BOM Fix AxisTest#submitInvalidAxisValue for plugin BOM Dec 18, 2023
@basil basil merged commit 0389fc6 into jenkinsci:master Dec 19, 2023
@MarkEWaite MarkEWaite deleted the fix-one-AxisTest branch December 24, 2024 11:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants