beehive-lab / TornadoVM

TornadoVM: A practical and efficient heterogeneous programming framework for managed languages
https://www.tornadovm.org
Apache License 2.0
1.17k stars 110 forks source link

Migrate from JUnit 4 to JUnit 5 #353

Open mikepapadim opened 5 months ago

mikepapadim commented 5 months ago

Description

Describe the patch. What does it enhance? What does it fix?

This PR implements the migration unit testing framework from JUnit 4 (JUnit 4.13.2 last updated Feb 13, 2021) to JUnit 5. This migration includes updating dependencies, annotations, assertions, and test instance lifecycle management.

Key changes:

Backend/s tested

Mark the backends affected by this PR.

OS tested

Mark the OS where this PR is tested.

How to test the new patch?

make 
make tests

jjfumero commented 5 months ago

@mikepapadim , if you solve the conflicts, we can merge this PR

mikepapadim commented 5 months ago

@mikepapadim , if you solve the conflicts, we can merge this PR

Lets hold this one.

I solved the conflicts with the latest develop, but now it seems that TestBatches cause a segfault

tornado -ea  --jvm "-Xmx6g -Dtornado.recover.bailout=False -Dtornado.unittests.verbose=True "  -m  tornado.unittests/uk.ac.manchester.tornado.unittests.tools.TornadoTestRunner  --params "uk.ac.manchester.tornado.unittests.batches.TestBatches"
WARNING: Using incubator modules: jdk.incubator.vector
Aborted (core dumped)

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007664629adb68, pid=79598, tid=79624
#
# JRE version: OpenJDK Runtime Environment (21.0+35) (build 21+35-2513)
# Java VM: OpenJDK 64-Bit Server VM (21+35-2513, mixed mode, tiered, jvmci, parallel gc, linux-amd64)
# Problematic frame:
# C  [libnvidia-opencl.so.1+0x1adb68]
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/share/apport/apport -p%p -s%s -c%c -d%d -P%P -u%u -g%g -- %E" (or dumping to /home/mikepapadim/manchester/TornadoVM/core.79598)
#
# An error report file with more information is saved as:
# /home/mikepapadim/manchester/TornadoVM/hs_err_pid79598.log
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

The rest of the tests are in par with develop:

==================================================
              Unit tests report 
==================================================

{'[PASS]': 565, '[FAILED]': 7, '[UNSUPPORTED]': 30}
Coverage [PASS/(PASS+FAIL)]: 98.78%
Coverage [PASS/(PASS+FAIL+UNSUPPORTED)]: 93.85%

==================================================
mikepapadim commented 5 months ago

[Update] SegFault also occurs with PTX for TestBatches

mikepapadim commented 4 months ago

[Update] I merged it with the latest develop to check the event fix-up if it influences the batch processing failures. Only, @gigiblender patch fixed the issue with batch processing, however, lazy copy-outs still fail. Batch processing on PTX is still failing.

mikepapadim commented 3 months ago

Thanks @gigiblender for the patch

mikepapadim commented 3 months ago

@jjfumero @stratika @mairooni when you have time can we do another iteration on testing,.

Now, it it stable to merge after we test it.

jjfumero commented 3 months ago

Let's check in OSx and Windows as well.

jjfumero commented 3 months ago

The batch processing with PTX still failing:

tornado -ea  --jvm "-Xmx6g -Dtornado.recover.bailout=False -Dtornado.unittests.verbose=True "  -m  tornado.unittests/uk.ac.manchester.tornado.unittests.tools.TornadoTestRunner  --params "uk.ac.manchester.tornado.unittests.batches.TestBatches"
WARNING: Using incubator modules: jdk.incubator.vector
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007faeb1d79937, pid=53407, tid=53408
#
# JRE version: Java(TM) SE Runtime Environment (21.0.3+7) (build 21.0.3+7-LTS-152)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (21.0.3+7-LTS-152, mixed mode, tiered, jvmci, parallel gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x979937]  jni_GetArrayLength+0x87
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/juan/tornadovm/TornadoVM/core.53407)
#
# An error report file with more information is saved as:
# /home/juan/tornadovm/TornadoVM/hs_err_pid53407.log
[6.098s][warning][os] Loading hsdis library failed
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#
mikepapadim commented 3 months ago

The batch processing with PTX still failing:

tornado -ea  --jvm "-Xmx6g -Dtornado.recover.bailout=False -Dtornado.unittests.verbose=True "  -m  tornado.unittests/uk.ac.manchester.tornado.unittests.tools.TornadoTestRunner  --params "uk.ac.manchester.tornado.unittests.batches.TestBatches"
WARNING: Using incubator modules: jdk.incubator.vector
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007faeb1d79937, pid=53407, tid=53408
#
# JRE version: Java(TM) SE Runtime Environment (21.0.3+7) (build 21.0.3+7-LTS-152)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (21.0.3+7-LTS-152, mixed mode, tiered, jvmci, parallel gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x979937]  jni_GetArrayLength+0x87
#
# Core dump will be written. Default location: Core dumps may be processed with "/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h" (or dumping to /home/juan/tornadovm/TornadoVM/core.53407)
#
# An error report file with more information is saved as:
# /home/juan/tornadovm/TornadoVM/hs_err_pid53407.log
[6.098s][warning][os] Loading hsdis library failed
#
# If you would like to submit a bug report, please visit:
#   https://bugreport.java.com/bugreport/crash.jsp
#

thats weird cause in my configuration with Driver Version: 550.67 CUDA Version: 12.4 it works