You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@seata.apache.org by "slievrly (via GitHub)" <gi...@apache.org> on 2024/04/02 05:54:18 UTC
Re: [PR] test: adjust the test cases related to dynamic configuration [incubator-seata]
slievrly commented on code in PR #6456:
URL: https://github.com/apache/incubator-seata/pull/6456#discussion_r1547175908
##########
config/seata-config-core/src/test/java/org/apache/seata/config/FileConfigurationTest.java:
##########
@@ -52,13 +52,20 @@ public void onChangeEvent(ConfigurationChangeEvent event) {
}
});
System.setProperty(dataId, String.valueOf(!value));
- countDownLatch.await(2, TimeUnit.SECONDS);
- System.setProperty("file.listener.enabled", "false");
+ countDownLatch.await(10, TimeUnit.SECONDS);
Review Comment:
I think you should add a synchronous assertion of the return value or the first value change.
In the case of past failures, one possible reason is that the configCache update was not triggered after await(2s), causing fileConfig.getBoolean(dataId) to return the cached old value. In the CachedConfigurationChangeListener assertion is not effective, because in the asynchronous link, every change in the value of the trigger, but the timing of the trigger is not controllable. Even if the test process exits, the asynchronous thread may not execute.
--
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: notifications-unsubscribe@seata.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@seata.apache.org
For additional commands, e-mail: notifications-help@seata.apache.org