XComp commented on code in PR #21736:
URL: https://github.com/apache/flink/pull/21736#discussion_r1183436858
##########
flink-fs-tests/src/test/java/org/apache/flink/hdfstests/ContinuousFileProcessingMigrationTest.java:
##########
@@ -309,17 +288,34 @@ public void testMonitoringSourceRestore() throws
Exception {
testHarness.setup();
- testHarness.initializeState(
- OperatorSnapshotUtil.getResourceFilename(
- "monitoring-function-migration-test-"
- + expectedModTime
- + "-flink"
- + testMigrateVersion
- + "-snapshot"));
+ // Get the exact filename
+ Tuple2<String, Long> fileNameAndModTime =
getResourceFilename(testMigrateVersion);
+
+ testHarness.initializeState(fileNameAndModTime.f0);
testHarness.open();
- Assert.assertEquals((long) expectedModTime,
monitoringFunction.getGlobalModificationTime());
+ Assert.assertEquals(
+ fileNameAndModTime.f1.longValue(),
monitoringFunction.getGlobalModificationTime());
+ }
+
+ private Tuple2<String, Long> getResourceFilename(FlinkVersion version)
throws IOException {
+ String resourceDirectory =
OperatorSnapshotUtil.getResourceFilename("");
+ Pattern fileNamePattern =
+ Pattern.compile(
+ "monitoring-function-migration-test-(\\d+)-flink"
Review Comment:
Ah true, I don't know why I missed that. Thanks for checking :+1:
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]