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

Try using stream harness support for unit testing #133

Open
Schmed opened this issue Apr 11, 2018 · 7 comments
Open

Try using stream harness support for unit testing #133

Schmed opened this issue Apr 11, 2018 · 7 comments
Assignees
Labels
in progress actively being worked on

Comments

@Schmed
Copy link
Member

Schmed commented Apr 11, 2018

Ken wrote:

There are classes for testing found in flink-test-utls-junit (I think this also requires mockito-all, e.g. version 1.10.19)

e.g. xxxInputStreamOperatorTestHarness, for example KeyedOneInputStreamOperatorTestHarness

Lets you test operators, including stateful operators/watermarks/etc.

There's apparently a bug in the checkpoint state management for DomainDBFunction. It would be cool to use see if we could design a test case that reproduces the problem and verifies the fix.

@Schmed
Copy link
Member Author

Schmed commented Apr 26, 2018

I was able to create a DomainDBFunctionTest that seems to demonstrate DomainDBFunction's inability to properly redistribute the saved state after the parallelism is changed. I've pushed the results to my 133_stream-test-harness branch (into which I've also merged recent changes from master).

I could try fixing the bug next Wednesday, but @kkrugler should feel free to take a crack at it before then if he so chooses.

@kkrugler
Copy link
Member

@Schmed - I've fixed the bug, and done a bit of cleanup. Changes are pushed.

But when I run mvn clean package from the command line, the DomainRankFunctionTest.test() hangs (stuck waiting for termination, log has repeated Sending heartbeat to JobManager entries).

Same thing if I run it from Eclipse. I'm thinking it might be related to switching to Flink 1.5-SNAPSHOT.

@kkrugler
Copy link
Member

kkrugler commented Jun 7, 2018

@Schmed - I think once Vivek has merged the 1.5 changes into master, you could merge/validate and close this issue, yes?

@kkrugler kkrugler added the in progress actively being worked on label Jun 27, 2018
@kkrugler
Copy link
Member

@Schmed - it would be great to also add a test for Restore pre-fetching state during restore of UrlDBFunction state.

@kkrugler
Copy link
Member

@Schmed - It would also be great to add a test for Sync up the total active urls value with state in UrlDbFunction.

@Schmed
Copy link
Member Author

Schmed commented Sep 13, 2018

I added a testRestorePreFetchingState, but it looks like you need to mock up some kind of reporter in order to gain access to the gauges created by a unit test, which seems like a lot of work.

See https://stackoverflow.com/questions/51675597/how-to-unitest-gauge-metrics-in-flink for an example.

@Schmed
Copy link
Member Author

Schmed commented Sep 19, 2018

I added a testRestorePreFetchingState, but it looks like you need to mock up some kind of reporter in order to gain access to the gauges created by a unit test, which seems like a lot of work.

See https://stackoverflow.com/questions/51675597/how-to-unitest-gauge-metrics-in-flink for an example.

see also Verify metrics using reporter approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in progress actively being worked on
Projects
None yet
Development

No branches or pull requests

2 participants