Просмотр исходного кода

fix(emqx_connector): restart with default wait_connected

EMQ-YangM 3 лет назад
Родитель
Сommit
ca7a43986a

+ 1 - 1
apps/emqx_connector/test/emqx_connector_mysql_SUITE.erl

@@ -90,7 +90,7 @@ perform_lifecycle_check(PoolName, InitialConfig) ->
     % Can call stop/1 again on an already stopped instance
     ?assertEqual(ok, emqx_resource:stop(PoolName)),
     % Make sure it can be restarted and the healthchecks and queries work properly
-    ?assertEqual(ok, emqx_resource:restart(PoolName)),
+    ?assertEqual(ok, emqx_resource:restart(PoolName, #{wait_connected => 1000})),
     {ok, ?CONNECTOR_RESOURCE_GROUP, #{status := InitialStatus}} = emqx_resource:get_instance(PoolName),
     ?assertEqual(ok, emqx_resource:health_check(PoolName)),
     ?assertMatch({ok, _, [[1]]}, emqx_resource:query(PoolName, test_query_no_params())),

+ 1 - 1
apps/emqx_connector/test/emqx_connector_pgsql_SUITE.erl

@@ -89,7 +89,7 @@ perform_lifecycle_check(PoolName, InitialConfig) ->
     % Can call stop/1 again on an already stopped instance
     ?assertEqual(ok, emqx_resource:stop(PoolName)),
     % Make sure it can be restarted and the healthchecks and queries work properly
-    ?assertEqual(ok, emqx_resource:restart(PoolName)),
+    ?assertEqual(ok, emqx_resource:restart(PoolName, #{wait_connected => 1000})),
     {ok, ?CONNECTOR_RESOURCE_GROUP, #{status := InitialStatus}} = emqx_resource:get_instance(PoolName),
     ?assertEqual(ok, emqx_resource:health_check(PoolName)),
     ?assertMatch({ok, _, [{1}]}, emqx_resource:query(PoolName, test_query_no_params())),

+ 1 - 1
apps/emqx_connector/test/emqx_connector_redis_SUITE.erl

@@ -103,7 +103,7 @@ perform_lifecycle_check(PoolName, InitialConfig, RedisCommand) ->
     % Can call stop/1 again on an already stopped instance
     ?assertEqual(ok, emqx_resource:stop(PoolName)),
     % Make sure it can be restarted and the healthchecks and queries work properly
-    ?assertEqual(ok, emqx_resource:restart(PoolName)),
+    ?assertEqual(ok, emqx_resource:restart(PoolName, #{wait_connected => 1000})),
     {ok, ?CONNECTOR_RESOURCE_GROUP, #{status := InitialStatus}} = emqx_resource:get_instance(PoolName),
     ?assertEqual(ok, emqx_resource:health_check(PoolName)),
     ?assertEqual({ok, <<"PONG">>}, emqx_resource:query(PoolName, {cmd, RedisCommand})),