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

Bugfix: Fix broken assertion in PipelineTest #22485

Merged
merged 2 commits into from
Aug 3, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.apache.beam.sdk;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.hasItem;
import static org.hamcrest.Matchers.instanceOf;
Expand Down Expand Up @@ -407,13 +406,9 @@ public void testReplaceAll() {
new PipelineVisitor.Defaults() {
@Override
public CompositeBehavior enterCompositeTransform(Node node) {
if (!node.isRootNode()) {
assertThat(
node.getTransform().getClass(),
not(
anyOf(
Matchers.equalTo(GenerateSequence.class),
Matchers.equalTo(Create.Values.class))));
String fullName = node.getFullName();
if (fullName.equals("unbounded") || fullName.equals("bounded")) {
assertThat(node.getTransform(), Matchers.instanceOf(EmptyFlatten.class));
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you explain this fix a bit?

Copy link
Member Author

@mosche mosche Aug 2, 2022

Choose a reason for hiding this comment

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

Rather than checking what the transform class after applying the replacement should not be (which was always the case anyways), this asserts that the resulting transform is an instance of the expected class

}
return CompositeBehavior.ENTER_TRANSFORM;
}
Expand Down