Skip to content

fix race in TestReceiver #1558

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
merged 3 commits into from
Jan 24, 2017
Merged

fix race in TestReceiver #1558

merged 3 commits into from
Jan 24, 2017

Conversation

pongad
Copy link
Contributor

@pongad pongad commented Jan 23, 2017

cc @davidtorres

If TestReceiver is set so that messages must be explicitly acked,
test code acks a message by calling replyNextOutstandingMessage.
There is a race between calling the function and the message being
delivered.

Previously, if the function gets called before the message is delivered,
the test fails since polling an empty deque returns a null pointer.
This commit makes us wait until a message becomes available instead.

If TestReceiver is set so that messages must be explicitly acked,
test code acks a message by calling replyNextOutstandingMessage.
There is a race between calling the function and the message being
delivered.

Previously, if the function gets called before the message is delivered,
the test fails since polling an empty deque returns a null pointer.
This commit makes us wait until a message becomes available instead.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 23, 2017
return;
}
replyTo(reply);
}

This comment was marked as spam.

This comment was marked as spam.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 2b8154d on pongad:sync-reply into ** on GoogleCloudPlatform:pubsub-hp**.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 861a318 on pongad:sync-reply into ** on GoogleCloudPlatform:pubsub-hp**.

@pongad pongad merged commit c68968b into googleapis:pubsub-hp Jan 24, 2017
@pongad pongad deleted the sync-reply branch January 24, 2017 03:29
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6a1eb08 on pongad:sync-reply into ** on GoogleCloudPlatform:pubsub-hp**.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants