Skip to content

Commit

Permalink
Merge pull request #100 from OrDTesters/fix-flaky-testCleanupOldJars
Browse files Browse the repository at this point in the history
HBASE-21467 Fix flaky test TestCoprocessorClassLoader.testCleanupOldJars
  • Loading branch information
saintstack authored Apr 23, 2019
2 parents 1644d74 + 3af7d02 commit 1584d24
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@ public void testCleanupOldJars() throws Exception {
File tmpJarFile = new File(jarFile.getParent(), "/tmp/" + className + ".test.jar");
if (tmpJarFile.exists()) tmpJarFile.delete();
assertFalse("tmp jar file should not exist", tmpJarFile.exists());
ClassLoader parent = TestCoprocessorClassLoader.class.getClassLoader();
CoprocessorClassLoader.getClassLoader(new Path(jarFile.getParent()), parent, "112", conf);
IOUtils.copyBytes(new FileInputStream(jarFile),
new FileOutputStream(tmpJarFile), conf, true);
assertTrue("tmp jar file should be created", tmpJarFile.exists());
Path path = new Path(jarFile.getAbsolutePath());
ClassLoader parent = TestCoprocessorClassLoader.class.getClassLoader();
CoprocessorClassLoader.parentDirLockSet.clear(); // So that clean up can be triggered
ClassLoader classLoader = CoprocessorClassLoader.getClassLoader(path, parent, "111", conf);
assertNotNull("Classloader should be created", classLoader);
Expand Down

0 comments on commit 1584d24

Please sign in to comment.