[
https://issues.apache.org/jira/browse/BEAM-3801?focusedWorklogId=80908&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-80908
]
ASF GitHub Bot logged work on BEAM-3801:
----------------------------------------
Author: ASF GitHub Bot
Created on: 15/Mar/18 18:01
Start Date: 15/Mar/18 18:01
Worklog Time Spent: 10m
Work Description: tgroh closed pull request #4816: [BEAM-3801] Add a
Length Prefix Idempotence Test
URL: https://github.com/apache/beam/pull/4816
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/runners/java-fn-execution/src/test/java/org/apache/beam/runners/fnexecution/graph/LengthPrefixUnknownCodersTest.java
b/runners/java-fn-execution/src/test/java/org/apache/beam/runners/fnexecution/graph/LengthPrefixUnknownCodersTest.java
index 4cfa5c0c545..90c9d191b7f 100644
---
a/runners/java-fn-execution/src/test/java/org/apache/beam/runners/fnexecution/graph/LengthPrefixUnknownCodersTest.java
+++
b/runners/java-fn-execution/src/test/java/org/apache/beam/runners/fnexecution/graph/LengthPrefixUnknownCodersTest.java
@@ -122,7 +122,7 @@ public boolean equals(Object obj) {
);
}
- @Parameter
+ @Parameter(0)
public Coder<?> original;
@Parameter(1)
@@ -143,5 +143,23 @@ public void test() throws IOException {
assertEquals(expected,
CoderTranslation.fromProto(updatedCoderProto.getCoder(),
RehydratedComponents.forComponents(updatedCoderProto.getComponents())));
+
+ // Test that the application of #forCoder is idempotent
+ String updatedCoderId =
+ LengthPrefixUnknownCoders.generateUniqueId(
+ "deserializedTestId",
updatedCoderProto.getComponents().getCodersMap().keySet());
+ Components updatedComponents =
+ updatedCoderProto
+ .getComponents()
+ .toBuilder()
+ .putCoders(updatedCoderId, updatedCoderProto.getCoder())
+ .build();
+ MessageWithComponents idempotencyCheck =
+ LengthPrefixUnknownCoders.forCoder(updatedCoderId, updatedComponents,
replaceWithByteArray);
+ assertEquals(
+ expected,
+ CoderTranslation.fromProto(
+ idempotencyCheck.getCoder(),
+
RehydratedComponents.forComponents(idempotencyCheck.getComponents())));
}
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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: 80908)
Time Spent: 1.5h (was: 1h 20m)
> Test that LengthPrefixing Unknown Coders is Idempotent
> ------------------------------------------------------
>
> Key: BEAM-3801
> URL: https://issues.apache.org/jira/browse/BEAM-3801
> Project: Beam
> Issue Type: Bug
> Components: runner-core
> Reporter: Thomas Groh
> Assignee: Thomas Groh
> Priority: Minor
> Fix For: Not applicable
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)