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

Fixing problems with remove_copy algorithm tests #1601

Merged
merged 1 commit into from
Jun 17, 2015

Conversation

hkaiser
Copy link
Member

@hkaiser hkaiser commented Jun 10, 2015

This fixes the occasional test failures we were seeing for the remove_copy_if tests. This also applies similar fly-by changes to the remove_copy test.

auto middle = boost::begin(c) + c.size()/2;
std::iota(boost::begin(c), middle, std::rand());
auto middle = boost::begin(c) + std::rand() % (c.size()/2);
std::iota(boost::begin(c), middle, static_cast<int>(std::rand() % c.size()));
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to make sure I understand the changes: Was the problem that std::iota was occasionally being given too large a value from std::rand()? And is line 26 changed just so that a random value from the 0th position to the 5003rd position is chosen instead of just the 5003rd position?

Copy link
Member Author

Choose a reason for hiding this comment

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

The first change (line 26) does not really fix anything, but rather increases the randomness of the tests by modifying the point from which on the input data is reset.

The second change (line 27) avoids that iota generates negative values (caused by overflowing before performing 5003 increments). This was causing the test to occasionally fail.

@dcbdan
Copy link
Contributor

dcbdan commented Jun 15, 2015

LGTM

hkaiser added a commit that referenced this pull request Jun 17, 2015
Fixing problems with remove_copy algorithm tests
@hkaiser hkaiser merged commit 3a80389 into master Jun 17, 2015
@hkaiser hkaiser deleted the fixed_remove_copy_test branch June 17, 2015 14:45
@hkaiser hkaiser restored the fixed_remove_copy_test branch June 17, 2015 15:34
@hkaiser
Copy link
Member Author

hkaiser commented Jun 17, 2015

This causes problems in buildbot, reverting...

@hkaiser hkaiser deleted the fixed_remove_copy_test branch June 17, 2015 15:36
@K-ballo
Copy link
Member

K-ballo commented Jun 17, 2015

This causes problems in buildbot

Any details on which problems does this PR cause? Buildbot seems to shows the same distribution of green, yellow and red before (bcb6705) and after (3a80389) it.

@K-ballo
Copy link
Member

K-ballo commented Jun 17, 2015

Nevermind, after looking at buildbot for some time I can see those two have been tested together, that's why there's no apparent difference in breakage.

@hkaiser
Copy link
Member Author

hkaiser commented Jun 17, 2015

Nod, and most of the breakage we see is still caused by file system issues on Hermione :/

@hkaiser hkaiser mentioned this pull request Jun 17, 2015
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.

3 participants