diff --git a/static_core/plugins/ets/tests/ets-templates/20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test.ets b/static_core/plugins/ets/tests/ets-templates/20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test.ets index 5339bbf7060a421f086c15923f7de1f9847e6b17..9be2150bfc53a96ad4cb8f1113c40e7cfd1a92d5 100644 --- a/static_core/plugins/ets/tests/ets-templates/20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test.ets +++ b/static_core/plugins/ets/tests/ets-templates/20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test.ets @@ -20,7 +20,7 @@ desc: >- Execution of some primitive type operations can throw OutOfMemoryError if allocation of new object is required but the available memory is not sufficient to perform it. -ark_options: ['--heap-size-limit=16777216'] +ark_options: ['--heap-size-limit=10485760','--compiler-enable-osr=false','--heap-verifier=fail_on_verification'] timeout: 1800 ---*/ @@ -33,17 +33,45 @@ function append () { array.push(n) // just store the variable in dynamic array } +function fillHeap() { + let holder : FixedArray = new Object[10]; + try { + for (let i = 0; i < holder.length; ++i) { + let res : FixedArray = new Byte[250 * 1024] + holder[i] = res + } + } catch (error: Error) { + console.log("catch error in fillHeap") + throw error + } + return holder +} + function main() { + try { + let holder = fillHeap(); + } catch (error: Error) { + if (error instanceof OutOfMemoryError) { + console.log("OutOfMemoryError when fillHeap") + throw new Error("OutOfMemoryError when fillHeap") + } + console.log("Unknown error when fillHeap") + throw new Error("Unknown error when fillHeap") + } try { for (;;) { // infinite loop append() } } catch (error: Error) { - if (error instanceof OutOfMemoryError) // OK - return + if (error instanceof OutOfMemoryError) { // OK + console.log("Out of memory from main loop count " + count) + throw new Error("Out of memory from main loop count " + count) + // return + } - throw error // Unknown error + console.log("Unknown error from main loop count " + count) // Unknown error + throw new Error("Unknown error from main loop count " + count) // Unknown error } } diff --git a/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-excluded-JIT-REPEATS.txt b/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-excluded-JIT-REPEATS.txt index c1db1fb9cb12e82b6311c1d4bab923b41a43742e..e9a1d27f9bd7b7c57bcd42e664f6c3b5ea1c7cf0 100644 --- a/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-excluded-JIT-REPEATS.txt +++ b/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-excluded-JIT-REPEATS.txt @@ -99,12 +99,3 @@ 17.experimental_features/16.async_functions_and_methods/02.async_methods/async_method26.ets 17.experimental_features/16.async_functions_and_methods/02.async_methods/async_method27.ets 17.experimental_features/16.async_functions_and_methods/02.async_methods/async_method28.ets - -#24226 RUNTIME_TIMEOUT - it required more than 600sec -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_0.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_1.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_2.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_3.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_4.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_5.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_6.ets diff --git a/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-ignored-AMD64.txt b/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-ignored-AMD64.txt index a04315bcefc8453da0129b51bb869ff045b6dacb..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-ignored-AMD64.txt +++ b/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-ignored-AMD64.txt @@ -1,8 +0,0 @@ -#24304 -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_0.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_1.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_2.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_3.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_4.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_5.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_6.ets diff --git a/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-ignored-ARM64-JIT.txt b/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-ignored-ARM64-JIT.txt index 6ece3d1fee948a4ae4eae7c834c60a056768dcd4..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-ignored-ARM64-JIT.txt +++ b/static_core/plugins/ets/tests/test-lists/ets-cts/ets-cts-ignored-ARM64-JIT.txt @@ -1,8 +0,0 @@ -#24304 ABORT_FAIL -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_0.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_1.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_2.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_3.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_4.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_5.ets -20.implementation_details/06.outofmemoryerror_for_primitive_type_operations/test_6.ets