Skip to content

Conversation

@demery-pivotal
Copy link
Contributor

Before: WANRollingUpgradeSecondaryEventsNotReprocessedAfterCurrentSiteMemberFailover allocated ports for two locators by making two separate calls to AvailablePort. AvailablePort randomly samples ports with replacement, and so two calls can return the same port if the port is not put into use between the calls.

Now: The test allocates both ports at the same time, and does so via AvailablePortHelper, which samples ports round robin rather than random with replacement.

Before: Several WAN rolling upgrade tests allocated ports for two
locators by making two separate calls to AvailablePort. AvailablePort
randomly samples ports with replacement, and so two calls can return the
same port if the port is not put into use between the calls. From time
to time, a test would get the same port for both locators, and the second
would fail to start because its port was already in use.

Now: The tests allocate both ports at the same time, ensuring that the
two ports differ. And they get their ports from AvailablePortHelper,
which allocates ports round robin instead of sampling with replacement,
further reducing the chance of collisions.
Copy link
Contributor

@mhansonp mhansonp left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning these up!

@demery-pivotal demery-pivotal merged commit 82f5df2 into apache:develop Dec 16, 2020
@demery-pivotal demery-pivotal deleted the geode-6622 branch December 16, 2020 20:04
@demery-pivotal
Copy link
Contributor Author

The one failing distributed test (MemberMXBeanDistributedTest) is unrelated to this PR and is known to fail intermittently:
https://issues.apache.org/jira/browse/GEODE-8191

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants