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 TestServerNodeEventFeed on Multi-CPU #1465

Merged
merged 1 commit into from
Jun 23, 2015

Conversation

mrtracy
Copy link
Contributor

@mrtracy mrtracy commented Jun 23, 2015

Related to #1436

This test was encountering a race condition with an asynchronous background
task, which affected its expected results on Multi-CPU test runs.

Specifically, this test monitors the node event feed, recording all RPCs called
on the node. However, in addition to the RPCs called by the test, there are also
RPCs being called by the Node's "StoresScanner", which were showing up in the
event feed. The exact ordering was unusually stable in single CPU tests, but the
race is readily exposed in a multi-CPU test run.

This temporary fix relaxes the final assertion of the test; the test still
requires that it sees the events it generates directly, but now it will not fail
if there are additional events that it did not expect.

A better, permanent fix is suggested in the TODO.

@mrtracy mrtracy assigned mrtracy and tamird and unassigned mrtracy Jun 23, 2015
// Advance indexes until one or both slices are exhausted.
for i < len(expected) && j < len(actual) {
// If the current expected value matches the current actual value,
// advance both indexes. Otherwise, advance only the actual index.
Copy link
Contributor

Choose a reason for hiding this comment

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

double space

@tamird
Copy link
Contributor

tamird commented Jun 23, 2015

LGTM

This test was encountering a race condition with an asynchronous background
task, which affected its expected results on Multi-CPU test runs.

Specifically, this test monitors the node event feed, recording all RPCs called
on the node. However, in addition to the RPCs called by the test, there are also
RPCs being called by the Node's "StoresScanner", which were showing up in the
event feed. The exact ordering was unusually stable in single CPU tests, but the
race is readily exposed in a multi-CPU test run.

This *temporary* fix relaxes the final assertion of the test; the test still
requires that it sees the events it generates directly, but now it will not fail
if there are additional events that it did not expect.

A better, permanent fix is suggested in the TODO.
@mrtracy mrtracy force-pushed the mtracy/fix_servernodefeed_multi_cpu branch from cb3debd to 78f51dc Compare June 23, 2015 21:00
mrtracy added a commit that referenced this pull request Jun 23, 2015
…ulti_cpu

Fix TestServerNodeEventFeed on Multi-CPU
@mrtracy mrtracy merged commit e2c64e1 into master Jun 23, 2015
@mrtracy mrtracy deleted the mtracy/fix_servernodefeed_multi_cpu branch June 23, 2015 21:16
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