You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2020/04/02 18:49:37 UTC

[GitHub] [flink] Myasuka opened a new pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Myasuka opened a new pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624
 
 
   ## What is the purpose of the change
   
   Enhance specific UTs to use customized `TtlTimeProvider` to simulate changed current time. This would introduce some changes to `AbstractStreamOperatorTestHarness` and add new `StreamTaskStateInitializerTestImpl` for different state backends.
   
   ## Brief change log
   Introduce some changes to `AbstractStreamOperatorTestHarness` and add new `StreamTaskStateInitializerTestImpl` for different state backends.
   
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   AbstractStreamOperatorTestHarnessTest#testSetTtlTimeProvider
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158278462",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c4207aa80f6279d013a51b9104997e840716640e Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/158278462) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158278462",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7326",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159765287",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * eb18708f59f83bdee706e5d0faaf83139e85adb8 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/159765287) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7326) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r406660790
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   What about going with this approach first? This can be merged faster and unblock other works. We can also continue the cleanup work using new builders, and expose custom time provider in builders to make it more flexible. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158278462",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7326",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "FAILURE",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159765287",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * eb18708f59f83bdee706e5d0faaf83139e85adb8 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/159765287) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7326) 
   * 607d235b0cf188cde57e3a447130d6debb0c3439 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 668797635ab529ea21ef234a1f99747cfb4d898a UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r402916524
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   I think either approach can be refactored in future.
   Using constructor is the usual way how we inject dependencies for tests. The inheritance is usually used to change more complicated internal behaviour.
   You could also keep the current constructor and add another one annotated with @VisibleForTesting which would accept the custom `TtlTimeProvider`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158278462",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7326",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159765287",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159863067",
       "triggerID" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "triggerType" : "PUSH"
     }, {
       "hash" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7339",
       "triggerID" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 607d235b0cf188cde57e3a447130d6debb0c3439 Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/159863067) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7339) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
wuchong commented on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-612550372
 
 
   Merging... 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r404590227
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   Then I think it makes sense to consider builders to avoid adding more harness constructors.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] Myasuka commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
Myasuka commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r402898687
 
 

 ##########
 File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/util/AbstractStreamOperatorTestHarnessTest.java
 ##########
 @@ -52,4 +55,24 @@ public void testInitializeAfterOpenning() throws Throwable {
 		result.open();
 		result.initializeState(new OperatorSubtaskState());
 	}
+
+	@Test
+	public void testSetTtlTimeProvider() throws Exception {
+		AbstractStreamOperatorTestHarness<Integer> result;
+		AbstractStreamOperator operator = new AbstractStreamOperator<Integer>() {};
+		result =
+			new AbstractStreamOperatorTestHarness<>(
+				operator,
+				1,
+				1,
+				0);
+		result.config.setStateKeySerializer(IntSerializer.INSTANCE);
+
+		long expectedTimeStamp = 42;
+		result.setTtlTimeProvider(() -> expectedTimeStamp);
+		result.initializeState(new OperatorSubtaskState());
+		result.open();
+		Assert.assertEquals(expectedTimeStamp,
+			((AbstractKeyedStateBackend<?>) operator.getKeyedStateBackend()).getTtlTimeProvider().currentTimestamp());
 
 Review comment:
   This sounds good, and I will update this test.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r402875546
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   Why not to inject this in the constructor of `StreamTaskStateInitializerImpl`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158278462",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c4207aa80f6279d013a51b9104997e840716640e Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/158278462) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049) 
   * eb18708f59f83bdee706e5d0faaf83139e85adb8 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r406631428
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   Why not `AbstractStreamOperatorTestHarness` always use a mocked `TtlTimeProvider`?  Just like always use the `TestProcessingTimeService`. Then we don't need to re-create the inner `streamTaskStateInitializer`.
   
   I also prefer the way to set processing time on the harness object `AbstractStreamOperatorTestHarness#setProcessingTime` instead of on other object `mockTtlTimeProvider.setCurrentTimeStamp(0L)`. We can provide a method `setStateTtlTime()` on the `AbstractStreamOperatorTestHarness` too. 
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r406692992
 
 

 ##########
 File path: flink-runtime/src/test/java/org/apache/flink/runtime/state/ttl/MockTtlTimeProvider.java
 ##########
 @@ -26,4 +26,8 @@
 	public long currentTimestamp() {
 		return time;
 	}
+
+	public void setCurrentTimeStamp(long timeStamp) {
 
 Review comment:
   ```suggestion
   	public void setCurrentTimestamp(long timestamp) {
   ```
   
   A lowercase for `S`?  

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158278462",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7326",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "FAILURE",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159765287",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * eb18708f59f83bdee706e5d0faaf83139e85adb8 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/159765287) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7326) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r402878447
 
 

 ##########
 File path: flink-streaming-java/src/test/java/org/apache/flink/streaming/util/AbstractStreamOperatorTestHarnessTest.java
 ##########
 @@ -52,4 +55,24 @@ public void testInitializeAfterOpenning() throws Throwable {
 		result.open();
 		result.initializeState(new OperatorSubtaskState());
 	}
+
+	@Test
+	public void testSetTtlTimeProvider() throws Exception {
+		AbstractStreamOperatorTestHarness<Integer> result;
+		AbstractStreamOperator operator = new AbstractStreamOperator<Integer>() {};
+		result =
+			new AbstractStreamOperatorTestHarness<>(
+				operator,
+				1,
+				1,
+				0);
+		result.config.setStateKeySerializer(IntSerializer.INSTANCE);
+
+		long expectedTimeStamp = 42;
+		result.setTtlTimeProvider(() -> expectedTimeStamp);
+		result.initializeState(new OperatorSubtaskState());
+		result.open();
+		Assert.assertEquals(expectedTimeStamp,
+			((AbstractKeyedStateBackend<?>) operator.getKeyedStateBackend()).getTtlTimeProvider().currentTimestamp());
 
 Review comment:
   I would avoid exposing `getTtlTimeProvider` in `AbstractKeyedStateBackend`, although we annotate with `VisibleForTesting`, it still becomes visible for users.
   The working of custom `TtlTimeProvider` can be tested e.g. by creating TTL states and checking that they expire according the custom timestamp. Also this will be tested by other tests which rely on this injection of custom `TtlTimeProvider`.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r406653233
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   This would indeed work. This is not flexible in general but may be good enough as we already have it for processing time.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158278462",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7326",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "FAILURE",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159765287",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159863067",
       "triggerID" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "triggerType" : "PUSH"
     }, {
       "hash" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7339",
       "triggerID" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * eb18708f59f83bdee706e5d0faaf83139e85adb8 Travis: [FAILURE](https://travis-ci.com/github/flink-ci/flink/builds/159765287) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7326) 
   * 607d235b0cf188cde57e3a447130d6debb0c3439 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/159863067) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7339) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r406653233
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   This would indeed work. This is not flexible in general but may be good enough and we already have it for processing time.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 668797635ab529ea21ef234a1f99747cfb4d898a Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/158015561) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006) 
   * c4207aa80f6279d013a51b9104997e840716640e UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158278462",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c4207aa80f6279d013a51b9104997e840716640e Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/158278462) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 668797635ab529ea21ef234a1f99747cfb4d898a Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/158015561) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot commented on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot commented on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608041997
 
 
   Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
   to review your pull request. We will use this comment to track the progress of the review.
   
   
   ## Automated Checks
   Last check on commit 668797635ab529ea21ef234a1f99747cfb4d898a (Thu Apr 02 18:53:18 UTC 2020)
   
   **Warnings:**
    * No documentation files were touched! Remember to keep the Flink docs up to date!
    * **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-16949).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
   
   
   <sub>Mention the bot in a comment to re-run the automated checks.</sub>
   ## Review Progress
   
   * ❓ 1. The [description] looks good.
   * ❓ 2. There is [consensus] that the contribution should go into to Flink.
   * ❓ 3. Needs [attention] from.
   * ❓ 4. The change fits into the overall [architecture].
   * ❓ 5. Overall code [quality] is good.
   
   Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
    The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
    - `@flinkbot approve all` to approve all aspects
    - `@flinkbot approve-until architecture` to approve everything until `architecture`
    - `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
    - `@flinkbot disapprove architecture` to remove an approval you gave earlier
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158278462",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7326",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "status" : "DELETED",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159765287",
       "triggerID" : "eb18708f59f83bdee706e5d0faaf83139e85adb8",
       "triggerType" : "PUSH"
     }, {
       "hash" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/159863067",
       "triggerID" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "triggerType" : "PUSH"
     }, {
       "hash" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7339",
       "triggerID" : "607d235b0cf188cde57e3a447130d6debb0c3439",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 607d235b0cf188cde57e3a447130d6debb0c3439 Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/159863067) Azure: [FAILURE](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7339) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] Myasuka commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
Myasuka commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r403207707
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   There existed another problem why we not change the constructor of `StreamTaskStateInitializerImpl`.
   Current `AbstractStreamOperatorTestHarness` is not created from a builder, and once a new `AbstractStreamOperatorTestHarness` is created, the inner `streamTaskStateInitializer` has been created with the default `TtlTimeProvider`. Even we set ttl time provider to `AbstractStreamOperatorTestHarness` later, the inner `streamTaskStateInitializer` would not notice the changed ttl time provider unless we call `AbstractStreamOperatorTestHarness#setup` to re-create the inner `streamTaskStateInitializer`. 
   However, `AbstractStreamOperatorTestHarness#setup` actually call a deprecated `SetupableStreamOperator#setup` interface. 
   In a nutshell, unless we refactor how we build `AbstractStreamOperatorTestHarness`, to make the customized ttl time provider take effect, we must call `AbstractStreamOperatorTestHarness#setup` each time which might already be treated as a deprecated interface.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 668797635ab529ea21ef234a1f99747cfb4d898a Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/158015561) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] Myasuka commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
Myasuka commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r402898020
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   I just don't want to introduce too many changes here. If we plan to inject this as a filed, I am in favor of moving `TtlTimeProvider` at operator level (by changing `StreamTaskStateInitializer#streamOperatorStateContext`) but not in the constructor which was [FLINK-14156](https://issues.apache.org/jira/browse/FLINK-14156) fixed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] wuchong commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
wuchong commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r406660790
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   What about going with this approach first? This can be merged faster and unblock other works. We can also continue the cleanup work using new builders after that, and expose custom time provider in builders to make it more flexible. 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c4207aa80f6279d013a51b9104997e840716640e",
       "status" : "PENDING",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158278462",
       "triggerID" : "c4207aa80f6279d013a51b9104997e840716640e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 668797635ab529ea21ef234a1f99747cfb4d898a Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/158015561) Azure: [SUCCESS](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006) 
   * c4207aa80f6279d013a51b9104997e840716640e Travis: [PENDING](https://travis-ci.com/github/flink-ci/flink/builds/158278462) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7049) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on issue #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#issuecomment-608048566
 
 
   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     }, {
       "hash" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "status" : "SUCCESS",
       "url" : "https://travis-ci.com/github/flink-ci/flink/builds/158015561",
       "triggerID" : "668797635ab529ea21ef234a1f99747cfb4d898a",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 668797635ab529ea21ef234a1f99747cfb4d898a Travis: [SUCCESS](https://travis-ci.com/github/flink-ci/flink/builds/158015561) Azure: [PENDING](https://dev.azure.com/rmetzger/5bd3ef0a-4359-41af-abca-811b04098d2e/_build/results?buildId=7006) 
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run travis` re-run the last Travis build
    - `@flinkbot run azure` re-run the last Azure build
   </details>

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] Myasuka commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
Myasuka commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r406658518
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   I think @wuchong 's suggestion is also a available choice. However, I think FLINK-17011 is the most clean solution to clean up these test code. Although I have to admit that PR https://github.com/apache/flink/pull/11676 is a bit large for reviewing.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] wuchong merged pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
wuchong merged pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [flink] azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider

Posted by GitBox <gi...@apache.org>.
azagrebin commented on a change in pull request #11624: [FLINK-16949] Enhance AbstractStreamOperatorTestHarness to use customized TtlTimeProvider
URL: https://github.com/apache/flink/pull/11624#discussion_r402916524
 
 

 ##########
 File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/operators/StreamTaskStateInitializerImpl.java
 ##########
 @@ -258,6 +258,10 @@ protected OperatorStateBackend operatorStateBackend(
 		}
 	}
 
+	protected TtlTimeProvider getTtlTimeProvider() {
 
 Review comment:
   I think either approach can be refactored in future.
   Using constructor is the usual way how we inject dependencies for tests. The inheritance is usually used to change more complicated internal behaviour.
   You could also keep the current constructor and add another one annotated with @VisibleForTesting which could accept the custom `TtlTimeProvider` field.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services