Skip to content

Commit 3af7d02

Browse files
committed
HBASE-21467 Fix flaky test TestCoprocessorClassLoader.testCleanupOldJars
1 parent 5e84997 commit 3af7d02

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hbase-common/src/test/java/org/apache/hadoop/hbase/util/TestCoprocessorClassLoader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ public void testCleanupOldJars() throws Exception {
6262
File tmpJarFile = new File(jarFile.getParent(), "/tmp/" + className + ".test.jar");
6363
if (tmpJarFile.exists()) tmpJarFile.delete();
6464
assertFalse("tmp jar file should not exist", tmpJarFile.exists());
65+
ClassLoader parent = TestCoprocessorClassLoader.class.getClassLoader();
66+
CoprocessorClassLoader.getClassLoader(new Path(jarFile.getParent()), parent, "112", conf);
6567
IOUtils.copyBytes(new FileInputStream(jarFile),
6668
new FileOutputStream(tmpJarFile), conf, true);
6769
assertTrue("tmp jar file should be created", tmpJarFile.exists());
6870
Path path = new Path(jarFile.getAbsolutePath());
69-
ClassLoader parent = TestCoprocessorClassLoader.class.getClassLoader();
7071
CoprocessorClassLoader.parentDirLockSet.clear(); // So that clean up can be triggered
7172
ClassLoader classLoader = CoprocessorClassLoader.getClassLoader(path, parent, "111", conf);
7273
assertNotNull("Classloader should be created", classLoader);

0 commit comments

Comments
 (0)