[
https://issues.apache.org/jira/browse/BEAM-8503?focusedWorklogId=337057&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-337057
]
ASF GitHub Bot logged work on BEAM-8503:
----------------------------------------
Author: ASF GitHub Bot
Created on: 31/Oct/19 21:17
Start Date: 31/Oct/19 21:17
Worklog Time Spent: 10m
Work Description: TheNeuralBit commented on pull request #9880:
[BEAM-8503] Improve TestBigQuery and TestPubsub
URL: https://github.com/apache/beam/pull/9880#discussion_r341369467
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/pubsub/TestPubsub.java
##########
@@ -172,6 +193,65 @@ public void publish(List<PubsubMessage> messages) throws
IOException {
pubsub.publish(eventsTopicPath, outgoingMessages);
}
+ /** Pull up to 100 messages from {@link #subscriptionPath()}. */
+ public List<PubsubMessage> pull() throws IOException {
+ return pull(100);
+ }
+
+ /** Pull up to {@code maxBatchSize} messages from {@link
#subscriptionPath()}. */
+ public List<PubsubMessage> pull(int maxBatchSize) throws IOException {
+ return pubsub.pull(0, subscriptionPath, 100, true).stream()
Review comment:
Ah I see. I dismissed the asynchronous option since it would require some
sort of synchronization, but that may be simpler. I can look at doing that as a
follow-up.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 337057)
Time Spent: 1h 40m (was: 1.5h)
> Improve TestBigQuery and TestPubsub
> -----------------------------------
>
> Key: BEAM-8503
> URL: https://issues.apache.org/jira/browse/BEAM-8503
> Project: Beam
> Issue Type: Improvement
> Components: testing
> Reporter: Brian Hulette
> Assignee: Brian Hulette
> Priority: Minor
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> Add better support for E2E BigQuery and Pubsub testing:
> - TestBigQuery should have the ability to insert data into the underlying
> table before a test.
> - TestPubsub should have the ability to subcribe to the underlying topic and
> read messages that were written during a test.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)