author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 20 Oct 2017 22:47:34 +0100 | |
branch | jv |
changeset 1958 | fadec117e77d |
parent 1957 | 91005025501a |
child 1959 | d05ea54888ee |
permissions | -rw-r--r-- |
1447 | 1 |
"{ Package: 'stx:goodies/regression' }" |
1181 | 2 |
|
3 |
"{ NameSpace: RegressionTests }" |
|
4 |
||
5 |
VMCrashTestCase subclass:#VMCrashTests |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'tests-Regression-RuntimeSystem' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!VMCrashTests methodsFor:'tests - GC'! |
|
14 |
||
1190
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
15 |
iter_java_initialize |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
16 |
<spawn: true> |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
17 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
18 |
1 to: 100 do:[:i | |
1447 | 19 |
Stdout nextPutLine: 'Pass ' , i printString. |
20 |
Java release: JavaRelease JDK7. |
|
21 |
Java initialize. |
|
22 |
JavaVM initializeVM. |
|
23 |
Java flushAllJavaResources. |
|
24 |
Stdout nextPutLine: 'Full GC...'. |
|
25 |
Smalltalk garbageCollect. |
|
26 |
Stdout nextPutLine: 'Pass ' , i printString , '...OK'. |
|
1190
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
27 |
]. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
28 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
29 |
"Created: / 08-09-2014 / 12:33:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
30 |
! |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
31 |
|
1953 | 32 |
test_issue_171_crash_in_Smalltalk_keys |
33 |
<timeout: 120> "2min" |
|
34 |
<spawn: true> |
|
35 |
||
36 |
" |
|
37 |
Commit a68e1e09f73a/stx:libbasic caused following code to crash the VM. |
|
38 |
" |
|
39 |
||
40 |
Smalltalk keys. |
|
41 |
||
42 |
"Created: / 09-08-2017 / 10:00:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
43 |
! |
|
44 |
||
1958 | 45 |
test_issue_182_crash_when_java_is_flushed |
46 |
<timeout: 300> "300min" |
|
47 |
<spawn: true> |
|
48 |
||
49 |
" |
|
50 |
If some code is still running when Java is flushed the |
|
51 |
VM crashed. |
|
52 |
" |
|
53 |
||
54 |
| blocker iters | |
|
55 |
||
56 |
Smalltalk loadPackage:'stx:libjava/tests'. |
|
57 |
||
58 |
blocker := Semaphore new. |
|
59 |
JavaVM reboot. |
|
60 |
||
61 |
[ |
|
62 |
[ |
|
63 |
| issue182 | |
|
64 |
||
65 |
issue182 := JAVA stx libjava tests mocks Issue182 new. |
|
66 |
issue182 loopFor: 15. |
|
67 |
] on: JavaClassFormatError do:[ |
|
68 |
"/ This is expected |
|
69 |
] on: Error do:[:ex | |
|
70 |
ex suspendedContext fullPrintAllOn: Stdout. |
|
71 |
]. |
|
72 |
blocker signal. |
|
73 |
] fork. |
|
74 |
Delay waitForSeconds: 5. |
|
75 |
JAVA stx libjava tests mocks Issue182 constantPool atAllPut: nil. |
|
76 |
blocker wait. |
|
77 |
||
78 |
"Created: / 19-10-2017 / 19:55:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
79 |
"Modified: / 26-10-2017 / 11:51:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
80 |
! |
|
81 |
||
1493 | 82 |
test_issue_64_vm_crashes_in_fclose |
83 |
" |
|
84 |
Quickly opening and closing files for long enough used to kill the |
|
85 |
VM. |
|
86 |
||
87 |
This testcase keeps opening and closing files for 10 minutes. Just a |
|
88 |
stress-test. |
|
89 |
" |
|
90 |
||
91 |
<spawn: true> |
|
92 |
<timeout: 660> "11min" |
|
93 |
||
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
94 |
| timeout deadline iterStart iterStop directory files oldSpaceSizeLimit i | |
1531
dbd517ea6e1c
Issue #64: Temporarily disabled "fclose" test on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
95 |
|
dbd517ea6e1c
Issue #64: Temporarily disabled "fclose" test on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
96 |
"/ See https://swing.fit.cvut.cz/projects/stx-jv/ticket/64 |
dbd517ea6e1c
Issue #64: Temporarily disabled "fclose" test on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
97 |
self skipIf: OperatingSystem isMSWINDOWSlike description: 'Temporarily skipped because of issue #64'. |
dbd517ea6e1c
Issue #64: Temporarily disabled "fclose" test on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
98 |
|
1493 | 99 |
|
100 |
timeout := self timeout. |
|
101 |
deadline := OperatingSystem getMillisecondTime + ((timeout - 60"extra min to cover variance") * 1000). |
|
102 |
iterStart := iterStop := 0. |
|
103 |
i := 0. |
|
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
104 |
directory := Smalltalk getPackageDirectoryForPackage: #'stx:goodies'. |
1598
300cd20b8c03
SnapshotRestartTests: do a compressing GC after some iterations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1531
diff
changeset
|
105 |
|
300cd20b8c03
SnapshotRestartTests: do a compressing GC after some iterations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1531
diff
changeset
|
106 |
oldSpaceSizeLimit := ObjectMemory oldSpaceUsed + (128"MB"*1024*1024). |
300cd20b8c03
SnapshotRestartTests: do a compressing GC after some iterations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1531
diff
changeset
|
107 |
|
1493 | 108 |
[ OperatingSystem getMillisecondTime < (deadline - (iterStop - iterStart)) ] whileTrue:[ |
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
109 |
iterStart := OperatingSystem getMillisecondTime. |
1493 | 110 |
|
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
111 |
i := i + 1. |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
112 |
Stdout nextPutLine: 'Pass ' , i printString. |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
113 |
files := directory recursiveDirectoryContentsAsFilenames select:[:each | each isRegularFile ]. |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
114 |
files := files select: [ :e | e suffix = 'st' ]. |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
115 |
files collect:[ :e | (FileStream fileNamed: e) contents asString ]. |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
116 |
Stdout nextPutLine: 'Pass ' , i printString , '...OK'. |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
117 |
(oldSpaceSizeLimit notNil and:[ ObjectMemory oldSpaceUsed > oldSpaceSizeLimit ]) ifTrue:[ |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
118 |
Stdout nextPutLine: 'GC'. |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
119 |
files := nil. |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
120 |
ObjectMemory compressingGarbageCollect. |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
121 |
oldSpaceSizeLimit := ObjectMemory oldSpaceUsed + (128"MB"*1024*1024). |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
122 |
Stdout nextPutLine: 'GC...OK '. |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
123 |
]. |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
124 |
iterStop := OperatingSystem getMillisecondTime. |
1493 | 125 |
]. |
126 |
||
1531
dbd517ea6e1c
Issue #64: Temporarily disabled "fclose" test on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
127 |
"Created: / 04-09-2016 / 03:16:19 / jv" |
1598
300cd20b8c03
SnapshotRestartTests: do a compressing GC after some iterations
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1531
diff
changeset
|
128 |
"Modified: / 27-02-2017 / 12:10:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1493 | 129 |
! |
130 |
||
1190
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
131 |
test_java_initialize |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
132 |
" |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
133 |
Running `JavaVM boot` for long enough used to kill the |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
134 |
VM due to problems in memory managements. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
135 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
136 |
This testcase runs for 10 minutes a test in separate VM |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
137 |
that 100 times boots and flushes the VM. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
138 |
" |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
139 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
140 |
<spawn: false> |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
141 |
<timeout: 660> "11min" |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
142 |
|
1447 | 143 |
| timeout deadline iterStart iterStop | |
1190
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
144 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
145 |
timeout := self timeout. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
146 |
deadline := OperatingSystem getMillisecondTime + ((timeout - 60"extra min to cover variance") * 1000). |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
147 |
iterStart := iterStop := 0. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
148 |
[ OperatingSystem getMillisecondTime < (deadline - (iterStop - iterStart)) ] whileTrue:[ |
1447 | 149 |
iterStart := OperatingSystem getMillisecondTime. |
150 |
(self class selector: #iter_java_initialize) runCase. |
|
151 |
iterStop := OperatingSystem getMillisecondTime. |
|
1190
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
152 |
]. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
153 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
154 |
"Created: / 08-09-2014 / 12:14:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
155 |
! |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
156 |
|
1181 | 157 |
test_newspace_overflow |
158 |
||
159 |
<timeout: 120> "2min" |
|
1193
4fd89b765c87
Added forgotten annotation <spawn:true> to newspace overflow test
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1190
diff
changeset
|
160 |
<spawn: true> |
1181 | 161 |
|
162 |
| newSize newLimit | |
|
163 |
||
164 |
newSize := ObjectMemory newSpaceSize. |
|
165 |
newLimit := (newSize * 0.9) rounded. |
|
166 |
"/ Allocate some garbage to fill in new space... |
|
167 |
[ ObjectMemory newSpaceUsed < newLimit ] whileTrue:[ |
|
1447 | 168 |
| a | |
1181 | 169 |
|
1447 | 170 |
a := Array new: 100. |
1181 | 171 |
]. |
1248
ab9af85de41a
class: RegressionTests::VMCrashTests
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
172 |
"/ Now, allocate some really huge object |
1498
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
173 |
[ |
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
174 |
String new: 300 * 1024 * 1024"300MB" |
1498
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
175 |
] on: AllocationFailure do:[:ex | |
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
176 |
"/ Do nothing, allocation failure is valid error |
1498
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
177 |
]. |
1181 | 178 |
|
179 |
"Created: / 05-09-2014 / 19:44:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1193
4fd89b765c87
Added forgotten annotation <spawn:true> to newspace overflow test
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1190
diff
changeset
|
180 |
"Modified: / 16-09-2014 / 18:50:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1498
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
181 |
"Modified: / 24-06-2016 / 00:41:29 / jv" |
1603
37db6f9f4ac5
Added test for regression in STX:LIBJAVA when compiled with `-O` or `-O2`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1598
diff
changeset
|
182 |
! |
37db6f9f4ac5
Added test for regression in STX:LIBJAVA when compiled with `-O` or `-O2`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1598
diff
changeset
|
183 |
|
1955
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
184 |
test_newspace_resize |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
185 |
|
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
186 |
<timeout: 120> "2min" |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
187 |
<spawn: true> |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
188 |
|
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
189 |
| newSize newLimit holder | |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
190 |
|
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
191 |
newSize := ObjectMemory newSpaceSize. |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
192 |
[ |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
193 |
ObjectMemory scavenge. |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
194 |
newLimit := (ObjectMemory newSpaceSize * 0.9) rounded. |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
195 |
|
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
196 |
"/ Fill in new space so it's 90% full, no garbage. |
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
197 |
holder := OrderedCollection new. |
1955
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
198 |
[ ObjectMemory newSpaceUsed < newLimit ] whileTrue:[ |
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
199 |
holder add: (Array new: 100). |
1955
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
200 |
]. |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
201 |
"/ Grow the new space to two times the current size. |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
202 |
ObjectMemory newSpaceSize: 2 * newSize. |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
203 |
self assert: (ObjectMemory newSpaceSize >= (2 * newSize)). |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
204 |
self assert: (ObjectMemory newSpaceUsed / ObjectMemory newSpaceSize) < 0.5. |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
205 |
|
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
206 |
"/ Fill in new space so it's 90% full, no garbage. |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
207 |
newLimit := (ObjectMemory newSpaceSize * 0.9) rounded. |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
208 |
[ ObjectMemory newSpaceUsed < newLimit ] whileTrue:[ |
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
209 |
holder add: (Array new: 100). |
1955
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
210 |
]. |
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
211 |
"/ Increase old space to make sure there's enough |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
212 |
"/ old space to tenure objects to. See |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
213 |
"/ |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
214 |
"/ ObjectMemory >> newSpaceSize: |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
215 |
"/ |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
216 |
ObjectMemory moreOldSpace: newSize * 2. |
1955
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
217 |
ObjectMemory newSpaceSize: newSize. |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
218 |
self assert: (ObjectMemory newSpaceSize < (newSize + 4096"page size as tolerance for page aligning")). |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
219 |
|
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
220 |
] ensure:[ |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
221 |
ObjectMemory newSpaceSize: newSize. |
1955
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
222 |
]. |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
223 |
|
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
224 |
"Created: / 21-09-2017 / 23:16:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1957
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
225 |
"Modified: / 05-10-2017 / 22:28:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
91005025501a
Fixed `VMCrashTests >> test_newspace_resize`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1955
diff
changeset
|
226 |
"Modified (comment): / 08-10-2017 / 23:51:30 / jv" |
1955
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
227 |
! |
509eae4c5c94
Added tests for newspace resizing (`ObjectMemory >> #newSpaceSize:`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1953
diff
changeset
|
228 |
|
1603
37db6f9f4ac5
Added test for regression in STX:LIBJAVA when compiled with `-O` or `-O2`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1598
diff
changeset
|
229 |
test_stx_libjava_testSuite_inspect |
37db6f9f4ac5
Added test for regression in STX:LIBJAVA when compiled with `-O` or `-O2`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1598
diff
changeset
|
230 |
<timeout: 120> "2min" |
37db6f9f4ac5
Added test for regression in STX:LIBJAVA when compiled with `-O` or `-O2`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1598
diff
changeset
|
231 |
<spawn: true> |
37db6f9f4ac5
Added test for regression in STX:LIBJAVA when compiled with `-O` or `-O2`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1598
diff
changeset
|
232 |
|
37db6f9f4ac5
Added test for regression in STX:LIBJAVA when compiled with `-O` or `-O2`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1598
diff
changeset
|
233 |
stx_libjava testSuite inspect. |
37db6f9f4ac5
Added test for regression in STX:LIBJAVA when compiled with `-O` or `-O2`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1598
diff
changeset
|
234 |
|
37db6f9f4ac5
Added test for regression in STX:LIBJAVA when compiled with `-O` or `-O2`
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1598
diff
changeset
|
235 |
"Created: / 01-05-2017 / 21:34:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1181 | 236 |
! ! |
237 |
||
238 |
!VMCrashTests class methodsFor:'documentation'! |
|
239 |
||
240 |
version |
|
241 |
^ '$Header$' |
|
242 |
! |
|
243 |
||
244 |
version_CVS |
|
245 |
^ '$Header$' |
|
1493 | 246 |
! |
247 |
||
248 |
version_HG |
|
249 |
||
250 |
^ '$Changeset: <not expanded> $' |
|
1181 | 251 |
! ! |
1958 | 252 |