peterxcli commented on PR #17551:
URL: https://github.com/apache/kafka/pull/17551#issuecomment-2423945548
Hi @chia7712,
thanks for the reminder!
Below is the test result on **before** and **after** running with `./gradlew
cleanTest server-common:test --rerun-tasks --tests KafkaEventQueueTest` command
to show the differences
---
Before:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="org.apache.kafka.queue.KafkaEventQueueTest" tests="13"
skipped="0" failures="0" errors="0" timestamp="2024-10-19T14:54:59"
hostname="MacBook-Pro-4.local" time="0.184">
<properties/>
<testcase name="testDeferredIsQueuedAfterTriggering()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.041"/>
<testcase name="testTimeouts()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.005"/>
<testcase name="testCreateAndClose()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.001"/>
<testcase name="testSize()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.008"/>
<testcase name="testHandleEvents()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.001"/>
<testcase name="testRejectedExecutionException()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.001"/>
<testcase name="testInterruptedWithDeferredEvents()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.001"/>
<testcase name="testHandleExceptionThrowingAnException()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.112"/>
<testcase name="testInterruptedWithEmptyQueue()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.002"/>
<testcase name="testShutdownBeforeDeferred()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.001"/>
<testcase name="testInterruptedExceptionHandling()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.0"/>
<testcase name="testScheduleDeferredWithTagReplacement()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.002"/>
<testcase name="testScheduleDeferred()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.002"/>
<system-out><![CDATA[[2024-10-19 22:54:59,500] ERROR [KafkaEventQueue
test=testHandleExceptionThrowingAnException()]Unexpected exception in
handleException (org.apache.kafka.queue.KafkaEventQueue:155)
java.lang.RuntimeException: Second exception
at
org.apache.kafka.queue.KafkaEventQueueTest$2.handleException(KafkaEventQueueTest.java:311)
at
org.apache.kafka.queue.KafkaEventQueue$EventContext.completeWithException(KafkaEventQueue.java:153)
at
org.apache.kafka.queue.KafkaEventQueue$EventContext.run(KafkaEventQueue.java:142)
at
org.apache.kafka.queue.KafkaEventQueue$EventHandler.handleEvents(KafkaEventQueue.java:215)
at
org.apache.kafka.queue.KafkaEventQueue$EventHandler.run(KafkaEventQueue.java:186)
at java.base/java.lang.Thread.run(Thread.java:1583)
]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>
```
After:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="org.apache.kafka.queue.KafkaEventQueueTest" tests="13"
skipped="0" failures="0" errors="0" timestamp="2024-10-19T15:06:50"
hostname="MacBook-Pro-4.local" time="0.48">
<properties/>
<testcase name="testDeferredIsQueuedAfterTriggering()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.138"/>
<testcase name="testTimeouts()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.011"/>
<testcase name="testCreateAndClose()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.002"/>
<testcase name="testSize()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.021"/>
<testcase name="testHandleEvents()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.016"/>
<testcase name="testRejectedExecutionException()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.009"/>
<testcase name="testInterruptedWithDeferredEvents()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.014"/>
<testcase name="testHandleExceptionThrowingAnException()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.113"/>
<testcase name="testInterruptedWithEmptyQueue()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.004"/>
<testcase name="testShutdownBeforeDeferred()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.003"/>
<testcase name="testInterruptedExceptionHandling()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.114"/>
<testcase name="testScheduleDeferredWithTagReplacement()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.003"/>
<testcase name="testScheduleDeferred()"
classname="org.apache.kafka.queue.KafkaEventQueueTest" time="0.003"/>
<system-out><![CDATA[[2024-10-19 23:06:50,993] INFO [KafkaEventQueue
test=testDeferredIsQueuedAfterTriggering()]KafkaEventQueue#close: shutting down
event queue. (org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:50,998] INFO [KafkaEventQueue
test=testDeferredIsQueuedAfterTriggering()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,022] INFO [KafkaEventQueue
test=testTimeouts()]KafkaEventQueue#close: shutting down event queue.
(org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,022] INFO [KafkaEventQueue test=testTimeouts()]closed
event queue. (org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,026] INFO [KafkaEventQueue
test=testCreateAndClose()]KafkaEventQueue#close: shutting down event queue.
(org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,026] INFO [KafkaEventQueue
test=testCreateAndClose()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,048] INFO [KafkaEventQueue
test=testSize()]KafkaEventQueue#close: shutting down event queue.
(org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,049] INFO [KafkaEventQueue test=testSize()]closed event
queue. (org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,063] INFO [KafkaEventQueue
test=testHandleEvents()]KafkaEventQueue#close: shutting down event queue.
(org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,064] INFO [KafkaEventQueue
test=testHandleEvents()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,072] INFO [KafkaEventQueue
test=testRejectedExecutionException()]KafkaEventQueue#close: shutting down
event queue. (org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,074] INFO [KafkaEventQueue
test=testRejectedExecutionException()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,087] WARN [KafkaEventQueue
test=testInterruptedWithDeferredEvents()]Interrupted while waiting for a
deferred event. Shutting down event queue
(org.apache.kafka.queue.KafkaEventQueue:292)
[2024-10-19 23:06:51,088] INFO [KafkaEventQueue
test=testInterruptedWithDeferredEvents()]KafkaEventQueue#close: shutting down
event queue. (org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,089] INFO [KafkaEventQueue
test=testInterruptedWithDeferredEvents()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,110] ERROR [KafkaEventQueue
test=testHandleExceptionThrowingAnException()]Unexpected exception in
handleException (org.apache.kafka.queue.KafkaEventQueue:155)
java.lang.RuntimeException: Second exception
at
org.apache.kafka.queue.KafkaEventQueueTest$2.handleException(KafkaEventQueueTest.java:311)
at
org.apache.kafka.queue.KafkaEventQueue$EventContext.completeWithException(KafkaEventQueue.java:153)
at
org.apache.kafka.queue.KafkaEventQueue$EventContext.run(KafkaEventQueue.java:142)
at
org.apache.kafka.queue.KafkaEventQueue$EventHandler.handleEvents(KafkaEventQueue.java:215)
at
org.apache.kafka.queue.KafkaEventQueue$EventHandler.run(KafkaEventQueue.java:186)
at java.base/java.lang.Thread.run(Thread.java:1583)
[2024-10-19 23:06:51,216] INFO [KafkaEventQueue
test=testHandleExceptionThrowingAnException()]KafkaEventQueue#close: shutting
down event queue. (org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,217] INFO [KafkaEventQueue
test=testHandleExceptionThrowingAnException()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,221] WARN [KafkaEventQueue
test=testInterruptedWithEmptyQueue()]Interrupted while waiting for a new event.
Shutting down event queue (org.apache.kafka.queue.KafkaEventQueue:284)
[2024-10-19 23:06:51,221] INFO [KafkaEventQueue
test=testInterruptedWithEmptyQueue()]KafkaEventQueue#close: shutting down event
queue. (org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,222] INFO [KafkaEventQueue
test=testInterruptedWithEmptyQueue()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,222] INFO [KafkaEventQueue
test=testInterruptedWithEmptyQueue()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,226] INFO [KafkaEventQueue
test=testShutdownBeforeDeferred()]testShutdownBeforeDeferred: shutting down
event queue. (org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,227] INFO [KafkaEventQueue
test=testShutdownBeforeDeferred()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,236] WARN [KafkaEventQueue
test=testInterruptedExceptionHandling()]Interrupted while running event.
Shutting down event queue (org.apache.kafka.queue.KafkaEventQueue:134)
[2024-10-19 23:06:51,342] INFO [KafkaEventQueue
test=testInterruptedExceptionHandling()]KafkaEventQueue#close: shutting down
event queue. (org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,342] INFO [KafkaEventQueue
test=testInterruptedExceptionHandling()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,346] INFO [KafkaEventQueue
test=testScheduleDeferredWithTagReplacement()]KafkaEventQueue#close: shutting
down event queue. (org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,346] INFO [KafkaEventQueue
test=testScheduleDeferredWithTagReplacement()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
[2024-10-19 23:06:51,350] INFO [KafkaEventQueue
test=testScheduleDeferred()]KafkaEventQueue#close: shutting down event queue.
(org.apache.kafka.queue.KafkaEventQueue:497)
[2024-10-19 23:06:51,351] INFO [KafkaEventQueue
test=testScheduleDeferred()]closed event queue.
(org.apache.kafka.queue.KafkaEventQueue:519)
]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>
```
---
It seems it can now retain the designated log level(default is `INFO`) logs
record under `test-result` folder! 🥳
---
Test logs files:
[TEST-org.apache.kafka.queue.KafkaEventQueueTest.zip](https://github.com/user-attachments/files/17445729/TEST-org.apache.kafka.queue.KafkaEventQueueTest.zip)
Not a virus, feel free to download it and check!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]