author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Fri, 24 Jun 2016 00:44:04 +0100 | |
branch | jv |
changeset 1498 | 398050ba2384 |
parent 1493 | 8da0d9b56e92 |
child 1499 | 26a16a04219b |
permissions | -rw-r--r-- |
1181 | 1 |
"{ Package: 'exept:regression' }" |
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 | |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
19 |
Stdout nextPutLine: 'Pass ' , i printString. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
20 |
Java release: JavaRelease JDK7. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
21 |
Java initialize. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
22 |
JavaVM initializeVM. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
23 |
Java flushAllJavaResources. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
24 |
Stdout nextPutLine: 'Full GC...'. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
25 |
Smalltalk garbageCollect. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
26 |
Stdout nextPutLine: 'Pass ' , i printString , '...OK'. |
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 |
|
1493 | 32 |
test_issue_64_vm_crashes_in_fclose |
33 |
" |
|
34 |
Quickly opening and closing files for long enough used to kill the |
|
35 |
VM. |
|
36 |
||
37 |
This testcase keeps opening and closing files for 10 minutes. Just a |
|
38 |
stress-test. |
|
39 |
" |
|
40 |
||
41 |
<spawn: true> |
|
42 |
<timeout: 660> "11min" |
|
43 |
||
44 |
| timeout deadline iterStart iterStop directory files i | |
|
45 |
||
46 |
timeout := self timeout. |
|
47 |
deadline := OperatingSystem getMillisecondTime + ((timeout - 60"extra min to cover variance") * 1000). |
|
48 |
iterStart := iterStop := 0. |
|
49 |
i := 0. |
|
50 |
directory := Smalltalk getPackageDirectoryForPackage: #'stx:goodies'. |
|
51 |
[ OperatingSystem getMillisecondTime < (deadline - (iterStop - iterStart)) ] whileTrue:[ |
|
52 |
iterStart := OperatingSystem getMillisecondTime. |
|
53 |
||
54 |
i := i + 1. |
|
55 |
Stdout nextPutLine: 'Pass ' , i printString. |
|
56 |
files := directory recursiveDirectoryContentsAsFilenames select:[:each | each isRegularFile ]. |
|
57 |
files := files select: [ :e | e suffix = 'st' ]. |
|
58 |
files collect:[ :e | (FileStream fileNamed: e) contents asString ]. |
|
59 |
Stdout nextPutLine: 'Pass ' , i printString , '...OK'. |
|
60 |
||
61 |
iterStop := OperatingSystem getMillisecondTime. |
|
62 |
]. |
|
63 |
||
64 |
"Created: / 23-06-2016 / 20:45:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
65 |
! |
|
66 |
||
1190
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
67 |
test_java_initialize |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
68 |
" |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
69 |
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
|
70 |
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
|
71 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
72 |
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
|
73 |
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
|
74 |
" |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
75 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
76 |
<spawn: false> |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
77 |
<timeout: 660> "11min" |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
78 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
79 |
| timeout deadline iterStart iterStop | |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
80 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
81 |
timeout := self timeout. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
82 |
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
|
83 |
iterStart := iterStop := 0. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
84 |
[ OperatingSystem getMillisecondTime < (deadline - (iterStop - iterStart)) ] whileTrue:[ |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
85 |
iterStart := OperatingSystem getMillisecondTime. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
86 |
(self class selector: #iter_java_initialize) runCase. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
87 |
iterStop := OperatingSystem getMillisecondTime. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
88 |
]. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
89 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
90 |
"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
|
91 |
! |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
92 |
|
1181 | 93 |
test_newspace_overflow |
94 |
||
95 |
<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
|
96 |
<spawn: true> |
1181 | 97 |
|
98 |
| newSize newLimit | |
|
99 |
||
100 |
newSize := ObjectMemory newSpaceSize. |
|
101 |
newLimit := (newSize * 0.9) rounded. |
|
102 |
"/ Allocate some garbage to fill in new space... |
|
103 |
[ ObjectMemory newSpaceUsed < newLimit ] whileTrue:[ |
|
104 |
| a | |
|
105 |
||
106 |
a := Array new: 100. |
|
107 |
]. |
|
1248
ab9af85de41a
class: RegressionTests::VMCrashTests
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
108 |
"/ Now, allocate some really huge object |
1498
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
109 |
[ |
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
110 |
String new: 300 * 1024 * 1024"300MB" |
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
111 |
] on: AllocationFailure do:[:ex | |
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
112 |
"/ Do nothing, allocation failure is valid error |
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
113 |
]. |
1181 | 114 |
|
115 |
"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
|
116 |
"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
|
117 |
"Modified: / 24-06-2016 / 00:41:29 / jv" |
1181 | 118 |
! ! |
119 |
||
120 |
!VMCrashTests class methodsFor:'documentation'! |
|
121 |
||
122 |
version |
|
123 |
^ '$Header$' |
|
124 |
! |
|
125 |
||
126 |
version_CVS |
|
127 |
^ '$Header$' |
|
1493 | 128 |
! |
129 |
||
130 |
version_HG |
|
131 |
||
132 |
^ '$Changeset: <not expanded> $' |
|
1181 | 133 |
! ! |
134 |