Bug 14220

Summary: ptest-runner cannot handle large child output
Product: [QA/Testing] Package Testing (ptest) Reporter: Yi Fan Yu <yf3yu>
Component: ptestAssignee: Aníbal Limón <anibal>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: anibal, randy.macleod
Version: unspecified   
Target Milestone: 3.3 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know
Bug Depends on:    
Bug Blocks: 14170    
Attachments:
Description Flags
proposed patch none

Description Yi Fan Yu 2021-02-04 16:46:59 UTC
Created attachment 4770 [details]
proposed patch

root cause of  https://bugzilla.yoctoproject.org/show_bug.cgi?id=14170

to reproduce this kind of issue:
make a ptest-run script to output a lot of data
ex: echo {1..1000000}\\n

echo will actually crash if you run it with ptest-runner

i think it is because in the source code of ptest-runner,
the parent process is reading from a non-blocking pipe and writing to a blocking stdout in  a loop. pipe might be full if parent is blocked.

attached is a proposed solution.
Comment 1 Randy MacLeod 2021-02-11 15:37:40 UTC
Put the reader in a separate thread.
Comment 2 Aníbal Limón 2021-03-23 02:18:10 UTC
Patches sent to ML and dev branch,

https://github.com/alimon/ptest-runner2/tree/ptest_fixes