'From Pharo8.0.0 of 5 June 2020 [Build information: Pharo-8.0.0+build.1140.sha.5e328f2d7e8ed65fbddfb761624df5a19d0400f7 (64 Bit)] on 16 June 2020 at 3:56:13.653327 pm'! TestCase subclass: #OSSubTest instanceVariableNames: 'process' classVariableNames: '' package: 'A'! !OSSubTest methodsFor: 'helpers' stamp: 'cd 6/16/2020 15:55'! codeToEvaluate [ 70 timesRepeat: [ Stdio stderr nextPutAll: (String loremIpsum: 1024). 0.01 second wait. 'timestamp.txt' writeStreamDo: [ :s | s nextPutAll: DateAndTime now asString ] ]. Smalltalk snapshot: false andQuit: true. ] fork! ! !OSSubTest methodsFor: 'helpers' stamp: 'cd 6/16/2020 15:38'! evaluationCodeString ^ (self class >> #codeToEvaluate) sourceCode allButFirst: #codeToEvaluate size + 1 "remove method name"! ! !OSSubTest methodsFor: 'running' stamp: 'cd 6/16/2020 15:54'! tearDown process isRunning ifTrue: [ process terminate ]! ! !OSSubTest methodsFor: 'tests' stamp: 'cd 6/16/2020 15:55'! testRunningAProcessAndListeningStdErrDoesNotFreeze | cmd | cmd := Smalltalk vm binary fullName, ' ' , Smalltalk image lastImagePath , ' eval "' , self evaluationCodeString , '"'. process := OSSUnixSubprocess new command: '/bin/bash'; arguments: {'-c' . cmd}; redirectStderr; run. 2 second wait. self assert: process isComplete! ! !OSSubTest methodsFor: 'tests' stamp: 'cd 6/16/2020 15:55'! testRunningAProcessDoesNotFreeze | cmd | cmd := Smalltalk vm binary fullName, ' ' , Smalltalk image lastImagePath , ' eval "' , self evaluationCodeString , '"'. process := OSSUnixSubprocess new command: '/bin/bash'; arguments: {'-c' . cmd}; run. 2 seconds wait. self assert: process isComplete! !