author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 01 Feb 2017 22:26:03 +0000 | |
branch | jv |
changeset 1948 | 62328a88e632 |
parent 1531 | dbd517ea6e1c |
child 1598 | 300cd20b8c03 |
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 |
|
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 |
||
1531
dbd517ea6e1c
Issue #64: Temporarily disabled "fclose" test on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
44 |
| timeout deadline iterStart iterStop directory files i | |
dbd517ea6e1c
Issue #64: Temporarily disabled "fclose" test on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
45 |
|
dbd517ea6e1c
Issue #64: Temporarily disabled "fclose" test on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
46 |
"/ 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
|
47 |
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
|
48 |
|
1493 | 49 |
|
50 |
timeout := self timeout. |
|
51 |
deadline := OperatingSystem getMillisecondTime + ((timeout - 60"extra min to cover variance") * 1000). |
|
52 |
iterStart := iterStop := 0. |
|
53 |
i := 0. |
|
54 |
directory := Smalltalk getPackageDirectoryForPackage: #'stx:goodies'. |
|
55 |
[ OperatingSystem getMillisecondTime < (deadline - (iterStop - iterStart)) ] whileTrue:[ |
|
56 |
iterStart := OperatingSystem getMillisecondTime. |
|
57 |
||
58 |
i := i + 1. |
|
59 |
Stdout nextPutLine: 'Pass ' , i printString. |
|
60 |
files := directory recursiveDirectoryContentsAsFilenames select:[:each | each isRegularFile ]. |
|
61 |
files := files select: [ :e | e suffix = 'st' ]. |
|
62 |
files collect:[ :e | (FileStream fileNamed: e) contents asString ]. |
|
63 |
Stdout nextPutLine: 'Pass ' , i printString , '...OK'. |
|
64 |
||
65 |
iterStop := OperatingSystem getMillisecondTime. |
|
66 |
]. |
|
67 |
||
1531
dbd517ea6e1c
Issue #64: Temporarily disabled "fclose" test on Windows
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
68 |
"Created: / 04-09-2016 / 03:16:19 / jv" |
1493 | 69 |
! |
70 |
||
1190
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
71 |
test_java_initialize |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
72 |
" |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
73 |
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
|
74 |
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
|
75 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
76 |
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
|
77 |
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
|
78 |
" |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
79 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
80 |
<spawn: false> |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
81 |
<timeout: 660> "11min" |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
82 |
|
1447 | 83 |
| timeout deadline iterStart iterStop | |
1190
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
84 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
85 |
timeout := self timeout. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
86 |
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
|
87 |
iterStart := iterStop := 0. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
88 |
[ OperatingSystem getMillisecondTime < (deadline - (iterStop - iterStart)) ] whileTrue:[ |
1447 | 89 |
iterStart := OperatingSystem getMillisecondTime. |
90 |
(self class selector: #iter_java_initialize) runCase. |
|
91 |
iterStop := OperatingSystem getMillisecondTime. |
|
1190
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
92 |
]. |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
93 |
|
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
94 |
"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
|
95 |
! |
cf332dfb2334
Added regression test #test_java_initialize
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1181
diff
changeset
|
96 |
|
1181 | 97 |
test_newspace_overflow |
98 |
||
99 |
<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
|
100 |
<spawn: true> |
1181 | 101 |
|
102 |
| newSize newLimit | |
|
103 |
||
104 |
newSize := ObjectMemory newSpaceSize. |
|
105 |
newLimit := (newSize * 0.9) rounded. |
|
106 |
"/ Allocate some garbage to fill in new space... |
|
107 |
[ ObjectMemory newSpaceUsed < newLimit ] whileTrue:[ |
|
1447 | 108 |
| a | |
1181 | 109 |
|
1447 | 110 |
a := Array new: 100. |
1181 | 111 |
]. |
1248
ab9af85de41a
class: RegressionTests::VMCrashTests
Claus Gittinger <cg@exept.de>
parents:
1193
diff
changeset
|
112 |
"/ Now, allocate some really huge object |
1498
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
113 |
[ |
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
114 |
String new: 300 * 1024 * 1024"300MB" |
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
115 |
] on: AllocationFailure do:[:ex | |
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
116 |
"/ Do nothing, allocation failure is valid error |
398050ba2384
Fixed VMCrashTests>>test_newspace_overflow
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1493
diff
changeset
|
117 |
]. |
1181 | 118 |
|
119 |
"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
|
120 |
"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
|
121 |
"Modified: / 24-06-2016 / 00:41:29 / jv" |
1181 | 122 |
! ! |
123 |
||
124 |
!VMCrashTests class methodsFor:'documentation'! |
|
125 |
||
126 |
version |
|
127 |
^ '$Header$' |
|
128 |
! |
|
129 |
||
130 |
version_CVS |
|
131 |
^ '$Header$' |
|
1493 | 132 |
! |
133 |
||
134 |
version_HG |
|
135 |
||
136 |
^ '$Changeset: <not expanded> $' |
|
1181 | 137 |
! ! |
138 |