JimMoen 1 год назад
Родитель
Сommit
0edeff4786

+ 2 - 1
apps/emqx/src/emqx_cpu_sup_worker.erl

@@ -78,7 +78,8 @@ handle_call({cpu_util, Args}, _From, State) ->
     Val = erlang:apply(cpu_sup, util, Args),
     {reply, Val, State};
 handle_call(Req, _From, State) ->
-    {reply, {error, {unexpected_call, Req}}, State}.
+    ?SLOG(error, #{msg => "unexpected_call", call => Req}),
+    {reply, ignored, State}.
 
 handle_cast(Msg, State) ->
     ?SLOG(error, #{msg => "unexpected_cast", cast => Msg}),

+ 1 - 1
apps/emqx/src/emqx_sys_sup.erl

@@ -28,7 +28,7 @@ start_link() ->
 init([]) ->
     OsMon =
         case emqx_os_mon:is_os_check_supported() of
-            true -> [child_spec(emqx_cpu_sup_worker), child_spec(emqx_os_mon)];
+            true -> [child_spec(emqx_os_mon), child_spec(emqx_cpu_sup_worker)];
             false -> []
         end,
     Children =

+ 2 - 1
apps/emqx/test/emqx_os_mon_SUITE.erl

@@ -132,7 +132,8 @@ do_sys_mem_check_alarm(_Config) ->
         get_memory_usage,
         fun() -> Mem end,
         fun() ->
-            timer:sleep(500),
+            %% wait for `os_mon` started
+            timer:sleep(10_000),
             Alarms = emqx_alarm:get_alarms(activated),
             ?assert(
                 emqx_vm_mon_SUITE:is_existing(