Skip to content

Make the peek method behaviour in the path selector deterministic #598 #600

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

Merged

Conversation

CaelmBleidd
Copy link
Member

@CaelmBleidd CaelmBleidd commented Jul 27, 2022

Description

Make a behaviour of the peek method of the path selector determenistic. To do it we fix taken random value between poll calls, so any sequence of the peek methods (and one following poll call) will take the same element of the queue.

Fixes #598

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Automated Testing

Any test for collections that try to find NoSuchElementException.

Manual Scenario

You can set a debug point at any place where there are several elements in the path selector's queue, and call peek method multiple times. Check that it doesn't calculate a random value every time and returns the same value all the time.

Checklist:

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

@CaelmBleidd CaelmBleidd requested review from dtim and volivan239 July 27, 2022 15:36
Copy link
Collaborator

@volivan239 volivan239 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #598 for me.

Copy link
Collaborator

@dtim dtim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CaelmBleidd CaelmBleidd merged commit 85921ca into main Jul 28, 2022
@CaelmBleidd CaelmBleidd deleted the caelmbleidd/non_deterministic_behaviour_of_the_poll_method branch July 28, 2022 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Flaky behavior of the tests depending on visualization option
3 participants