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

Builds are sometimes not added to the history list #31

Closed
dominikgolda opened this issue Jan 22, 2020 · 3 comments
Closed

Builds are sometimes not added to the history list #31

dominikgolda opened this issue Jan 22, 2020 · 3 comments
Assignees
Labels
bug Something isn't working Priority: High

Comments

@dominikgolda
Copy link
Collaborator

dominikgolda commented Jan 22, 2020

buildsSometimesNotAdded

There is a failing unit test BuildsShouldNotBeMissedWhenBuildsAreRunningOneAfterAnother. I think it fails on some mocks, which were not refactored, but maybe fixing it is some starting point.

@dominikgolda dominikgolda added bug Something isn't working Priority: High labels Jan 22, 2020
@dominikgolda
Copy link
Collaborator Author

af387d0 is likely cause of the problem. It certainly breaks the unit test.

dominikgolda added a commit that referenced this issue Jan 23, 2020
…ther. If there are missig builds reevaluate history.
@dominikgolda dominikgolda self-assigned this Jan 24, 2020
@dominikgolda
Copy link
Collaborator Author

The bug itself is fixed. Only the unit test remains to be fixed.

dominikgolda added a commit that referenced this issue Jan 27, 2020
e7092e3). The original version caused some history builds to be added to history more then once. Also fixed unit test for that feature.
@dominikgolda
Copy link
Collaborator Author

It turns out the unit test was failing because the feature wasn't working. The problem was due to how adding to queue works. We first remove the last value, then we add new one and then we sort by age. As a result when we had ex. builds 10, 9, 8, 7, 6 and we added 11, 10, 9, 8, 7 in turns the result was that we ended up with 11, 10, 10, 9, 7. The steps were:

  • Adding 11:
    11, 10, 9, 8, 7
    -Adding 10:
    11, 10, 10, 9, 8
  • Adding 9:
    11, 10, 10, 9, 9
    -Adding 8:
    11, 10, 10, 9, 8
    -Adding 7:
    11, 10, 10, 9, 7

The fix was to just query the missing build and add it to queue, which should improve performance. Alternatively we could clear the history before reloading it.

Apart from what was actually not working the unit test required adjusting to changes in JenkinAPI class.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority: High
Projects
None yet
Development

No branches or pull requests

1 participant