Explorar o código

test: make sure gauge return to 0 in test cases

Zaiming (Stone) Shi %!s(int64=3) %!d(string=hai) anos
pai
achega
bf8becd521
Modificáronse 1 ficheiros con 14 adicións e 0 borrados
  1. 14 0
      apps/emqx_resource/test/emqx_resource_SUITE.erl

+ 14 - 0
apps/emqx_resource/test/emqx_resource_SUITE.erl

@@ -2102,6 +2102,10 @@ t_expiration_batch_all_expired_after_reply(_Config) ->
                         late_reply := 1,
                         retried := 0,
                         failed := 0
+                    },
+                    gauges := #{
+                        inflight := 0,
+                        queuing := 0
                     }
                 },
                 Metrics
@@ -2217,6 +2221,16 @@ do_t_expiration_retry(IsBatch) ->
                 [#{expired := [{query, _, {inc_counter, 1}, _, _}]}],
                 ?of_kind(buffer_worker_retry_expired, Trace)
             ),
+            Metrics = tap_metrics(?LINE),
+            ?assertMatch(
+                #{
+                    gauges := #{
+                        inflight := 0,
+                        queuing := 0
+                    }
+                },
+                Metrics
+            ),
             ok
         end
     ),