瀏覽代碼

scripts/test.py: Fix infinite busy loops on macOS

I confirmed that the same number of tests are run
with "make test" on:

    * Ubuntu with and without this change
    * macOS with this change

>   ====== results ======
>   tests passed 817/817 (100.00%)
>   tests failed 0/817 (0.00%)
YAMAMOTO Takashi 4 年之前
父節點
當前提交
3bee4d9a19
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      scripts/test.py

+ 4 - 0
scripts/test.py

@@ -292,6 +292,8 @@ class TestCase:
                     if e.errno == errno.EIO:
                         break
                     raise
+                if not line:
+                    break;
                 stdout.append(line)
                 if args.get('verbose'):
                     sys.stdout.write(line)
@@ -687,6 +689,8 @@ def main(**args):
             if e.errno == errno.EIO:
                 break
             raise
+        if not line:
+            break;
         stdout.append(line)
         if args.get('verbose'):
             sys.stdout.write(line)