flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-25537] [JUnit5 Migration] Module: flink-core package api-common

Open GOODBOY008 opened this issue 2 years ago • 5 comments

[FLINK-25537] [JUnit5 Migration] Module: flink-core package api-common

GOODBOY008 avatar Dec 20 '23 07:12 GOODBOY008

CI report:

  • 0102360e65785c149256abc2561bb0c0ca5bf174 UNKNOWN
  • 69167a81a7f85e57ac199bf358034af2ee98d29d Azure: SUCCESS
Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

flinkbot avatar Dec 20 '23 08:12 flinkbot

@flinkbot run azure

GOODBOY008 avatar Dec 20 '23 09:12 GOODBOY008

@1996fanrui PTAL

GOODBOY008 avatar Dec 26 '23 05:12 GOODBOY008

https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=55925&view=logs&j=0da23115-68bb-5dcd-192c-bd4c8adebde1&t=24c3384f-1bcb-57b3-224f-51bf973bbee8&l=7264

The CI fails due to the change of this PR, right?

1996fanrui avatar Jan 01 '24 09:01 1996fanrui

https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=55925&view=logs&j=0da23115-68bb-5dcd-192c-bd4c8adebde1&t=24c3384f-1bcb-57b3-224f-51bf973bbee8&l=7264

The CI fails due to the change of this PR, right?

@1996fanrui Yes, CI failure just fixed now. PTAL

GOODBOY008 avatar Jan 03 '24 14:01 GOODBOY008

Hi @1996fanrui, Since this PR is quite large, can you help double-check it?

Thanks @GOODBOY008 for the hard work and @Jiabao-Sun for the hard review. I will review this week.

1996fanrui avatar Feb 21 '24 10:02 1996fanrui

@GOODBOY008 can you please double check that the amount of tests before this PR and after is still same?

snuyanzin avatar Feb 22 '24 06:02 snuyanzin

Thank all of you to review this pr. I will check unit test amount.

GOODBOY008 avatar Feb 23 '24 05:02 GOODBOY008

@flinkbot run azure

GOODBOY008 avatar Feb 24 '24 02:02 GOODBOY008

@Jiabao-Sun @1996fanrui @snuyanzin I compare with ci log between master (https://github.com/apache/flink/actions/runs/8002818046/job/21857253878) and this pr (https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=57835&view=logs&j=0da23115-68bb-5dcd-192c-bd4c8adebde1&t=24c3384f-1bcb-57b3-224f-51bf973bbee8). The unit test amount is correct.

  • The result is below, PR unit test amount more than master, becuase of some test contain Assume to ignore some test in master branch:

diff: org.apache.flink.core.fs.local.LocalFileSystemTest 12 13
diff: org.apache.flink.runtime.state.filesystem.FsCheckpointStateOutputStreamTest 22 24
diff: org.apache.flink.runtime.blob.BlobCacheDeleteTest 9 11
diff: org.apache.flink.runtime.webmonitor.handlers.JarDeleteHandlerTest 2 3
diff: org.apache.flink.runtime.blob.BlobServerGetTest 11 13
diff: org.apache.flink.runtime.execution.librarycache.BlobLibraryCacheManagerTest 20 22
diff: org.apache.flink.util.FileUtilsTest 21 22
diff: org.apache.flink.runtime.blob.BlobCacheGetTest 9 17
diff: org.apache.flink.runtime.blob.BlobServerPutTest 21 30
diff: org.apache.flink.runtime.rest.RestServerEndpointTest 2 3
diff: org.apache.flink.runtime.blob.BlobServerDeleteTest 13 16
diff: org.apache.flink.contrib.streaming.state.RocksDBStateBackendConfigTest 30 31
diff: org.apache.flink.runtime.taskexecutor.TaskManagerRunnerStartupTest 3 4
diff: org.apache.flink.runtime.blob.BlobCachePutTest 19 28
diff key between master and aiden: org.apache.flink.runtime.blob.BlobUtilsNonWritableTest
  • The code is below:
public static void main(String[] args) {
        // 2024-02-22T10:56:50.1618765Z Feb 22 10:56:50 10:56:50.161 [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.173 s -- in org.apache.flink.state.api.DataSetMemoryStateBackendReaderKeyedStateITCase
        // extract the number of tests by regex

        Map<String, Integer> aidenMap = new HashMap<>();
        Map<String, Integer> masterMap = new HashMap<>();

        FileUtil.readUtf8Lines("D:\\opt\\aiden.txt").forEach(log -> extracted(log, aidenMap));
        FileUtil.readUtf8Lines("D:\\opt\\core.txt").forEach(log -> extracted(log, masterMap));

        masterMap.forEach((key, value) -> {
            if (aidenMap.containsKey(key)) {
                if (!Objects.equals(value, aidenMap.get(key))) {
                    System.out.println("diff: " + key + " " + value + " " + aidenMap.get(key));
                }
            } else {
                System.out.println("not found: " + key);
            }
        });
        // diff masterMap and aidenMap by key
        CollUtil.disjunction(masterMap.keySet(), aidenMap.keySet()).forEach(key -> System.out.println("diff key between master and aiden: " + key));
    }

    private static void extracted(String log, Map<String, Integer> map) {
        // 正则表达式匹配数字和类名
        String regex = "Tests run: (\\d+).*in (.*)";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(log);

        // 找到匹配项并打印
        if (matcher.find()) {
            String testRun = matcher.group(1);
            String className = matcher.group(2);
            map.put(className, Integer.parseInt(testRun));
        }
    }

GOODBOY008 avatar Feb 25 '24 01:02 GOODBOY008