apache / incubator-streampark

Make stream processing easier! Easy-to-use streaming application development framework and operation platform.
https://streampark.apache.org/
Apache License 2.0
3.88k stars 1.01k forks source link

[Improve] failed to execute all unit tests #1597

Closed lvyanquan closed 2 years ago

lvyanquan commented 2 years ago

Search before asking

What happened

Failed to execute 'mvnw clean package' under the directory of this project, the execution will be blocked as following:

[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ streampark-console-service ---
[INFO] Surefire report directory: /Users/admin/IdeaProjects/incubator-streampark/streampark-console/streampark-console-service/target/surefire-reports
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running CompletableFutureTest
Force cancel future.
The future is cancelled.
Future is timed out.
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 15.107 sec - in CompletableFutureTest
Running RefreshCacheTest
2022-09-14 00:05:20
The future is done.
The future is done.
2022-09-14 00:05:30
2022-09-14 00:05:40
2022-09-14 00:05:50
2022-09-14 00:06:00
2022-09-14 00:06:10
......

StreamPark Version

1.2.4

Java Version

1.8

Flink Version

1.14

Scala Version of Flink

2.12

Error Exception

@Test
    public void task() throws InterruptedException {
        System.out.println(DateUtils.format(new Date(), DateUtils.fullFormat(), TimeZone.getDefault()));
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                System.out.println(DateUtils.format(new Date(), DateUtils.fullFormat(), TimeZone.getDefault()));
            }
        }, 1000 * 10, 1000 * 10);
        Thread.sleep(Long.MAX_VALUE);
    }

this method doesn't exit.

Screenshots

Are you willing to submit PR?

Code of Conduct

wolfboys commented 2 years ago

Most open-source projects skip test when package: mvnw clean package -DskipTests

lvyanquan commented 2 years ago

Yeah, it's not a bug that blocks main process and will have no effort on use of the product. But I think unit test is still a way to improve code quality and code review. ---- separate line ---- Sorry. Then I found we actually skip these two modules in gitHub action check, in action of "Maven Package Test", we use

Run mvn -B test -pl '!streampark-plugin/streampark-jvm-profiler,!streampark-console/streampark-console-service' -am

So this class won't block the gitHub action of test, but I think it's still unnecessary.

I will close this issue later if no other opinion is proposed.

wolfboys commented 2 years ago

Thanks for your feedback, look at it this way, there is really no need this testcase