Skip to content

Commit cad939d

Browse files
authored
Update the baseline to use Unicode from github
- Modify the baseline: to use Unicode from github - Fix the open file count in OSSFileBasedUnixSubprocessTest by only counting open pipes - Fix usage of travis_wait to effectively extend the maximum test run time.
2 parents 1c69d12 + 02a5dfe commit cad939d

File tree

5 files changed

+20
-29
lines changed

5 files changed

+20
-29
lines changed

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,4 @@ before_script:
2121
- mkdir -p $SMALLTALK_CI_BUILD/UCD && cp UCD/* $SMALLTALK_CI_BUILD/UCD/
2222

2323
script:
24-
- travis_wait 120 sleep infinity &
25-
- $SMALLTALK_CI_HOME/run.sh ${CI_FILE}
24+
- travis_wait 60 $SMALLTALK_CI_HOME/run.sh ${CI_FILE}

repository/BaselineOfOSSubprocess.package/BaselineOfOSSubprocess.class/instance/baseline..st

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ baseline: spec
88
package: 'OSSubprocess' with: [ spec requires: 'FFICHeaderExtractor' ];
99
package: 'OSSubprocess-Tests-Unit' with: [ spec requires: #('OSSubprocess' 'Unicode') ];
1010
package: 'OSSubprocess-Tests-Stress' with: [ spec requires: 'OSSubprocess-Tests-Unit' ].
11-
11+
1212
spec baseline: 'FFICHeaderExtractor' with: [
13-
spec repository: 'github://marianopeck/FFICHeaderExtractor:master/repository' ].
14-
15-
spec project: 'Unicode' with: [
16-
spec
17-
className: #ConfigurationOfUnicode;
18-
versionString: #'stable';
19-
repository: 'http://smalltalkhub.com/mc/Pharo/Unicode/main/' ].
20-
13+
spec repository: 'github://marianopeck/FFICHeaderExtractor/repository' ].
14+
15+
spec baseline: 'Unicode' with: [
16+
spec repository: 'github://pharo-contributions/pharo-unicode/repository' ].
17+
2118
spec
2219
group: 'Core' with: #( 'OSSubprocess' );
2320
group: 'Tests' with: #( 'OSSubprocess-Tests-Unit' 'OSSubprocess-Tests-Stress' ).
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
helpers
22
getStreamsInfoForRunningTest
3-
"We obtain the open tmp files before the open files because apparently getting the entries of /tmp using
3+
"We obtain the open tmp files before the open files because in Pharo 7 and ealier getting the entries of /tmp using
4+
45
'/tmp' asFileReference entries
5-
6-
opens a file descriptor and lets the FD open. Thus #numberOfOpenFiles, using lsof, detects /tmp as an open file and makes the test fail.
7-
8-
This happens only in travis under Ubuntu.
9-
"
6+
7+
leaves the /tmp file descriptor open. Thus #numberOfOpenFiles, using lsof, detects /tmp as an open file and makes the test fail.
8+
Fixed in Pharo 8."
109
| openTmpFiles |
1110
openTmpFiles := self numberOfExistingTempStreamFiles.
1211
^ Array with: self numberOfOpenFiles with: openTmpFiles
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,16 @@
11
helpers
22
numberOfOpenFiles
3-
"This is estimation number. Not to be used for real code. IT's basically
4-
to check the number of opened files (regular files, directories, pipes) at the beginning of a test and at the end, to validate we are not leaving behind opened files.
5-
This should work in most Unix-like and Linux
6-
"
3+
"This is estimation number. Not to be used for real code. It's basically to check the number of opened FIFO files at the beginning of a test and at the end, to validate we are not leaving behind opened files.
4+
This should work in most Unix-like and Linux systems.
5+
Only FIFO files are checked as we can't control other threads, and it is redirecting stdio that is happening in the tests."
76
| tmpFileName openFiles |
87
tmpFileName := (FileSystem workingDirectory / 'openFilesByPharoVM-' , UUID new printString) fullName.
98
tmpFileName asFileReference ensureDelete.
109
self systemAccessor system: ('lsof -p ', OSSVMProcess vmProcess pid printString, ' > "', tmpFileName, '" 2>&1').
1110
openFiles := tmpFileName asFileReference readStreamDo: [ :str | | lines |
12-
"We avoid the first header line"
13-
lines := str contents lines allButFirst sorted.
14-
15-
"We then ignore all file properties except for the file name"
16-
lines collect: [ :each | each substrings last ]
11+
lines := str contents lines.
12+
"Count only pipes"
13+
lines select: [ :each | each includesSubstring: 'FIFO' ]
1714
].
1815
tmpFileName asFileReference ensureDelete.
19-
^ openFiles
20-
16+
^ openFiles size

repository/OSSubprocess-Tests-Unit.package/OSSUnixSubprocessTest.class/instance/testReadingFromStdoutAfterCommandFinishesDoesNotBlocksVM.st

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ testReadingFromStdoutAfterCommandFinishesDoesNotBlocksVM
1212
streamsInfo := self getStreamsInfoForRunningTest.
1313
command := self newCommand
1414
command: '/bin/sleep';
15-
arguments: (Array with: '15');
15+
arguments: (Array with: '1');
1616
redirectStdout;
1717
runAndWait.
1818

0 commit comments

Comments
 (0)