Updated smoke-test.mjs with 9 additions and 5 removals
--- a/smoke-test.mjs
+++ b/smoke-test.mjs
@@ -230,8 +230,12 @@
                 console.error('Error cleaning up data file:', error);
             }
         }
-    }
-}
-
-runSmokeTest();
-
+    } finally {
+        if (logStream) {
+            await logStream.close();
+        }
+    }
+}
+
+runSmokeTest();
+