You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2022/02/16 17:16:12 UTC

[GitHub] [kafka] free2create commented on a change in pull request #11752: KAFKA-13666 Only ignore test exceptions for windows OS.

free2create commented on a change in pull request #11752:
URL: https://github.com/apache/kafka/pull/11752#discussion_r808258300



##########
File path: streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java
##########
@@ -1094,29 +1095,37 @@ private void throwIfBuiltInStore(final StateStore stateStore) {
      * Close the driver, its topology, and all processors.
      */
     public void close() {
-        if (task != null) {
-            task.suspend();
-            task.prepareCommit();
-            task.postCommit(true);
-            task.closeClean();
-        }
-        if (globalStateTask != null) {
-            try {
-                globalStateTask.close(false);
-            } catch (final IOException e) {
-                // ignore
+        try {
+            if (task != null) {
+                task.suspend();
+                task.prepareCommit();
+                task.postCommit(true);
+                task.closeClean();
+            }
+            if (globalStateTask != null) {
+                try {
+                    globalStateTask.close(false);
+                } catch (final IOException e) {
+                    // ignore
+                }
+            }
+            completeAllProcessableWork();
+            if (task != null && task.hasRecordsQueued()) {
+                log.warn("Found some records that cannot be processed due to the" +
+                                " {} configuration during TopologyTestDriver#close().",
+                        StreamsConfig.MAX_TASK_IDLE_MS_CONFIG);
+            }
+            if (processingMode == AT_LEAST_ONCE) {
+                producer.close();
+            }
+            stateDirectory.clean();
+        } catch (final RuntimeException rex) {
+            if (OperatingSystem.IS_WINDOWS) {
+                log.warn("Ignoring exception for windows, issue may be similar to resolved issue: https://issues.apache.org/jira/browse/KAFKA-6647", rex);
+            } else {

Review comment:
       Done, I reverted change to TestDriver so errors just occur. It is also one less Windows OS test in framework,




-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org