[
https://issues.apache.org/jira/browse/IOTDB-2220?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Pai reassigned IOTDB-2220:
-------------------------------
Assignee: Eric Pai
> Unexpected MQTTService shutdown causing unit cases runs too slow
> ----------------------------------------------------------------
>
> Key: IOTDB-2220
> URL: https://issues.apache.org/jira/browse/IOTDB-2220
> Project: Apache IoTDB
> Issue Type: Bug
> Affects Versions: master branch
> Reporter: Eric Pai
> Assignee: Eric Pai
> Priority: Major
> Fix For: master branch
>
> Attachments: image-2021-12-28-17-44-34-272.png
>
>
> I invegistate recent CI and find some simple unit test cases take too long
> time to run.
> !image-2021-12-28-17-44-34-272.png!
> I add some logs to watch the unit test and see that when
> EnvironmentUtils.cleanEnv() is called, the MQTTService costs at least 2
> seconds to stop. If there're many cases using @Before and @After to setup and
> teardown environments, it will cost a lot of time. (PhysicalPlanTest has 86
> individual test cases).
>
> The root cause is in the MQTTSinkTest: The setUp() enables the MQTTService in
> the IoTDBDescriptor but the tearDown() doesn't reset it. This causes the all
> following tests enables the MQTTService, as junit is a single process and
> IoTDBDescriptor is a singletion instance.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)