From 41450a5136968f3eb05c4950078cf315a2d30baf Mon Sep 17 00:00:00 2001 From: Jason Song Date: Wed, 13 Feb 2019 11:25:34 +0800 Subject: [PATCH] adjust wait timeout for tests which might be slower than others --- .../spring/JavaConfigPlaceholderAutoUpdateTest.java | 10 +++++----- .../spring/XmlConfigPlaceholderAutoUpdateTest.java | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/JavaConfigPlaceholderAutoUpdateTest.java b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/JavaConfigPlaceholderAutoUpdateTest.java index 18d899c6a19..8bdfb02a715 100644 --- a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/JavaConfigPlaceholderAutoUpdateTest.java +++ b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/JavaConfigPlaceholderAutoUpdateTest.java @@ -485,7 +485,7 @@ public void testAutoUpdateWithDeletedPropertiesWithNoDefaultValue() throws Excep config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(100); + TimeUnit.MILLISECONDS.sleep(300); assertEquals(newTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -515,7 +515,7 @@ public void testAutoUpdateWithTypeMismatch() throws Exception { config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(100); + TimeUnit.MILLISECONDS.sleep(300); assertEquals(newTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -539,7 +539,7 @@ public void testAutoUpdateWithTypeMismatchWithYamlFile() throws Exception { configFile.onRepositoryChange("application.yaml", readYamlContentAsConfigFileProperties("case5-new.yaml")); - TimeUnit.MILLISECONDS.sleep(100); + TimeUnit.MILLISECONDS.sleep(300); assertEquals(newTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -907,7 +907,7 @@ public void testAutoUpdateJsonValueWithInvalidValue() throws Exception { config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(100); + TimeUnit.MILLISECONDS.sleep(300); // should not change anything assertTrue(jsonBean == bean.getJsonBean()); @@ -934,7 +934,7 @@ public void testAutoUpdateJsonValueWithNoValueAndNoDefaultValue() throws Excepti config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(100); + TimeUnit.MILLISECONDS.sleep(300); // should not change anything assertTrue(jsonBean == bean.getJsonBean()); diff --git a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderAutoUpdateTest.java b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderAutoUpdateTest.java index 1c5336f31a7..275845a05a5 100644 --- a/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderAutoUpdateTest.java +++ b/apollo-client/src/test/java/com/ctrip/framework/apollo/spring/XmlConfigPlaceholderAutoUpdateTest.java @@ -315,7 +315,7 @@ public void testAutoUpdateWithDeletedPropertiesWithNoDefaultValue() throws Excep config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(100); + TimeUnit.MILLISECONDS.sleep(300); assertEquals(newTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch()); @@ -345,7 +345,7 @@ public void testAutoUpdateWithTypeMismatch() throws Exception { config.onRepositoryChange(ConfigConsts.NAMESPACE_APPLICATION, newProperties); - TimeUnit.MILLISECONDS.sleep(100); + TimeUnit.MILLISECONDS.sleep(300); assertEquals(newTimeout, bean.getTimeout()); assertEquals(initialBatch, bean.getBatch());