line / decaton

High throughput asynchronous task processing on Apache Kafka
Apache License 2.0
336 stars 51 forks source link

Fix flaky test MetricsTest. testMetricsLifecycleManagement #94

Closed ocadaruma closed 3 years ago

ocadaruma commented 3 years ago

testMetricsLifecycleManagement fails in #93 (refs: https://github.com/line/decaton/pull/93/checks?check_run_id=2026634635), but it succeeds on my local and seems not related to the changes of #93.

com.linecorp.decaton.processor.metrics.MetricsTest > testMetricsLifecycleManagement FAILED
    java.lang.AssertionError: expected:<[MeterId{name='decaton.tasks.scheduling.delay', tags=[tag(partition=1),tag(subscription=abc),tag(topic=topic)]}, MeterId{name='decaton.partition.throttled.time', tags=[tag(partition=1),tag(subscription=abc),tag(topic=topic)]}]> but was:<[MeterId{name='decaton.processor.compaction.compacted.keys', tags=[tag(subscription=subscription)]}, MeterId{name='decaton.processor.processed.time', tags=[tag(partition=0),tag(subpartition=0),tag(subscription=subscription),tag(topic=topic)]}, MeterId{name='decaton.partition.throttled.time', tags=[tag(partition=0),tag(subscription=subscription),tag(topic=topic)]}, MeterId{name='decaton.retry.queued.tasks', tags=[tag(subscription=subscription)]}, MeterId{name='decaton.subscription.process.durations', tags=[tag(section=poll),tag(subscription=subsc)]}, MeterId{name='decaton.subscription.process.durations', tags=[tag(section=commit),tag(subscription=subsc)]}, MeterId{name='decaton.tasks.process.duration', tags=[tag(partition=1),tag(subscription=subscriptionId),tag(topic=topic)]}, MeterId{name='decaton.subscription.process.durations', tags=[tag(section=reload),tag(subscription=subsc)]}, MeterId{name='decaton.partition.paused.time', tags=[tag(partition=0),tag(subscription=subscription),tag(topic=topic)]}, MeterId{name='decaton.tasks.discarded', tags=[tag(partition=1),tag(subscription=subscriptionId),tag(topic=topic)]}, MeterId{name='decaton.processor.compaction.compacted', tags=[tag(subscription=subscription)]}, MeterId{name='decaton.tasks.error', tags=[tag(partition=1),tag(subscription=subscriptionId),tag(topic=topic)]}, MeterId{name='decaton.tasks.scheduling.delay', tags=[tag(partition=1),tag(subscription=abc),tag(topic=topic)]}, MeterId{name='decaton.partition.queue.starved.time', tags=[tag(partition=0),tag(subscription=subscription),tag(topic=topic)]}, MeterId{name='decaton.tasks.scheduling.delay', tags=[tag(partition=0),tag(subscription=subscription),tag(topic=topic)]}, MeterId{name='decaton.tasks.processed', tags=[tag(partition=1),tag(subscription=subscriptionId),tag(topic=topic)]}, MeterId{name='decaton.tasks.pending', tags=[tag(partition=0),tag(subscription=subscription),tag(topic=topic)]}, MeterId{name='decaton.partition.throttled.time', tags=[tag(partition=1),tag(subscription=abc),tag(topic=topic)]}, MeterId{name='decaton.subscription.process.durations', tags=[tag(section=records),tag(subscription=subsc)]}, MeterId{name='decaton.retry.queueing.failed', tags=[tag(subscription=subscription)]}, MeterId{name='decaton.tasks.complete.duration', tags=[tag(partition=1),tag(subscription=subscriptionId),tag(topic=topic)]}, MeterId{name='decaton.partition.paused', tags=[tag(partition=0),tag(subscription=subscription),tag(topic=topic)]}, MeterId{name='decaton.subscription.process.durations', tags=[tag(section=pause),tag(subscription=subsc)]}, MeterId{name='decaton.tasks.queued', tags=[tag(partition=0),tag(subpartition=0),tag(subscription=subscription),tag(topic=topic)]}]>
        at org.junit.Assert.fail(Assert.java:89)
        at org.junit.Assert.failNotEquals(Assert.java:835)
        at org.junit.Assert.assertEquals(Assert.java:120)
        at org.junit.Assert.assertEquals(Assert.java:146)
        at com.linecorp.decaton.processor.metrics.MetricsTest.testMetricsLifecycleManagement(MetricsTest.java:53)
ocadaruma commented 3 years ago

Fixed by https://github.com/line/decaton/pull/95