File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -82,16 +82,22 @@ public void testGCNativeLibrary() throws Exception {
8282 }
8383
8484 public void testAvoidDuplicateLoads () throws Exception {
85- NativeLibrary .disposeAll ();
86- // Give the system a moment to unload the library; on OSX we
87- // occasionally get the same library handle back on subsequent dlopen
88- Thread .sleep (2 );
89-
90- TestLibrary lib = Native .load ("testlib" , TestLibrary .class );
91- assertEquals ("Library should be newly loaded after explicit dispose of all native libraries" ,
92- 1 , lib .callCount ());
93- if (lib .callCount () <= 1 ) {
94- fail ("Library should not be reloaded without dispose" );
85+ // This test basicly tests whether unloading works. It relies on the
86+ // runtime to unload the library when dlclose is called. This is not
87+ // required by POSIX and dt time of writing macOS is known to be flaky
88+ // in that regard.
89+ //
90+ // This test causes false test failures
91+ if (!Platform .isMac ()) {
92+ NativeLibrary .disposeAll ();
93+ Thread .sleep (2 );
94+
95+ TestLibrary lib = Native .load ("testlib" , TestLibrary .class );
96+ assertEquals ("Library should be newly loaded after explicit dispose of all native libraries" ,
97+ 1 , lib .callCount ());
98+ if (lib .callCount () <= 1 ) {
99+ fail ("Library should not be reloaded without dispose" );
100+ }
95101 }
96102 }
97103
You can’t perform that action at this time.
0 commit comments