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

[BEAM-14499] Fix TestStream integration tests #17733

Closed
wants to merge 3 commits into from

Conversation

jrmccluskey
Copy link
Contributor

Fixes TestStream tests by introducing a new WindowedEqualsList() function that passes a window function down to wrap necessary components of the Equals() transforms in. This avoids pipeline construction-time failures in TestStream test cases.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@asf-ci
Copy link

asf-ci commented May 23, 2022

Can one of the admins verify this patch?

4 similar comments
@asf-ci
Copy link

asf-ci commented May 23, 2022

Can one of the admins verify this patch?

@asf-ci
Copy link

asf-ci commented May 23, 2022

Can one of the admins verify this patch?

@asf-ci
Copy link

asf-ci commented May 23, 2022

Can one of the admins verify this patch?

@asf-ci
Copy link

asf-ci commented May 23, 2022

Can one of the admins verify this patch?

@github-actions github-actions bot added the go label May 23, 2022
@codecov
Copy link

codecov bot commented May 23, 2022

Codecov Report

Merging #17733 (4d699ff) into master (1dfab62) will decrease coverage by 0.00%.
The diff coverage is 70.37%.

@@            Coverage Diff             @@
##           master   #17733      +/-   ##
==========================================
- Coverage   73.98%   73.98%   -0.01%     
==========================================
  Files         696      696              
  Lines       91851    91871      +20     
==========================================
+ Hits        67958    67968      +10     
- Misses      22644    22653       +9     
- Partials     1249     1250       +1     
Flag Coverage Δ
go 50.45% <70.37%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdks/go/pkg/beam/testing/passert/equals.go 89.18% <60.00%> (-0.98%) ⬇️
sdks/go/pkg/beam/testing/passert/passert.go 73.56% <100.00%> (-5.19%) ⬇️
sdks/go/pkg/beam/testing/passert/passert.shims.go 54.34% <0.00%> (-2.90%) ⬇️
sdks/go/pkg/beam/windowing.go 18.91% <0.00%> (+18.91%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1dfab62...4d699ff. Read the comment docs.

@jrmccluskey
Copy link
Contributor Author

Run Go Flink ValidatesRunner

@jrmccluskey
Copy link
Contributor Author

R: @damccorm @riteshghorse

@github-actions
Copy link
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

sdks/go/pkg/beam/testing/passert/equals.go Show resolved Hide resolved
// cannot be globally windowed.
func windowedEquals(s beam.Scope, wfn *window.Fn, actual, expected beam.PCollection) beam.PCollection {
unexpected, correct, missing := WindowedDiff(s, wfn, actual, expected)
beam.ParDo0(s, failIfBadEntries, beam.WindowInto(s, wfn, beam.Impulse(s)), beam.SideInput{Input: unexpected}, beam.SideInput{Input: correct}, beam.SideInput{Input: missing})
Copy link
Contributor

Choose a reason for hiding this comment

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

Right now I don't think failIfBadEntries prints out windowing information - it probably should since that can now make a difference.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we can be window function aware at that level.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I meant information about the actual window, not the windowing function. Basically, if you get different results because of windowing it would be nice if that was obvious from the error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay that was more doable. We have a windowing call-out now.

t.Errorf("Pipeline failed: %v", err)
}
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a test or two for windowing equality? Ideally at least 1 success and 1+ failures

@@ -44,6 +45,21 @@ func Diff(s beam.Scope, a, b beam.PCollection) (left, both, right beam.PCollecti
return beam.ParDo3(s, &diffFn{Type: beam.EncodedType{T: t.Type()}}, imp, beam.SideInput{Input: a}, beam.SideInput{Input: b})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I want to call out that we no longer actually use this ourselves, so its theoretically a candidate for deprecation/removal. With that said, I think this is both public and usable enough that people might have dependencies on it, so I don't really think that's a good idea. Mostly just had the thought and wanted to see how others feel about it.

sdks/go/pkg/beam/testing/passert/equals.go Show resolved Hide resolved
@jrmccluskey
Copy link
Contributor Author

Current Go SDK testing utilities and primitives (namely Impulse) don't play nicely with the windowing and streaming set-up, so this approach will not work. Closing this PR and stepping back the breaking case to a warning in #17735

@jrmccluskey jrmccluskey deleted the streamFix branch May 24, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants