Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails test on Mac OS 12.6.5 (ThreadTest.testJNIThreadAttachFromNativeCallbacks) #680

Open
mrlimbic opened this issue May 18, 2023 · 9 comments

Comments

@mrlimbic
Copy link

Downloaded latest snapshot and cannot build on intel mac. This test fails. Any ideas why?

[ERROR] Failures: 
[ERROR]   ThreadTest.testJNIThreadAttachFromNativeCallbacks:100
[INFO] 
[ERROR] Tests run: 70, Failures: 1, Errors: 0, Skipped: 0
@saudet
Copy link
Member

saudet commented May 18, 2023 via email

@mrlimbic
Copy link
Author

I tried jdk 11, 17, 18 and 20.

@saudet
Copy link
Member

saudet commented May 18, 2023

What's the error message that you get from the failed test?

@mrlimbic
Copy link
Author

Assertion error. Looks like took too long.

"Time elapsed: 0.004 s <<< FAILURE!"

org.bytedeco.javacpp.ThreadTest.txt

@saudet
Copy link
Member

saudet commented May 18, 2023

There's probably a race condition happening on your system for some reason that makes the main thread finish before the other thread. I wouldn't worry about it, but we should figure out how to make the test work more reliability. A Thread.sleep(100) before that line might do the trick.

@mrlimbic
Copy link
Author

mrlimbic commented May 18, 2023

I added Thread.sleep(100) before the assert and still fails.

Going to try on my new laptop which is running a later Mac OS to see if same happens.

-------------------------------------------------------------------------------
Test set: org.bytedeco.javacpp.ThreadTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 1.43 s <<< FAILURE! - in org.bytedeco.javacpp.ThreadTest
testJNIThreadAttachFromNativeCallbacks(org.bytedeco.javacpp.ThreadTest)  Time elapsed: 0.11 s  <<< FAILURE!
java.lang.AssertionError
	at org.bytedeco.javacpp.ThreadTest.testJNIThreadAttachFromNativeCallbacks(ThreadTest.java:107)

@mrlimbic
Copy link
Author

mrlimbic commented May 18, 2023

Tried building on my intel laptop with JDK 17 + Mac OS 10.13.1(a) but same test fails again.

Do you really think it is not indicative of a problem on Mac OS, only the test that is not good?

@saudet
Copy link
Member

saudet commented May 19, 2023

@masterav10 Any ideas?

@masterav10
Copy link
Contributor

Have you tried pulling out the relevant parts from the generated "jnijavacpp.cpp" and see how they behave natively? I use visual studio on Windows, which is where I do most of my testing. I remember doing this quite a bit when I was testing the original feature.

Without looking too closely, I didn't touch anything mac-related, unless you are running a cpp11 compiler. In this case, you get the new behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants