Skip to content

Commit

Permalink
HBASE-21467 Fix flaky test TestCoprocessorClassLoader.testCleanupOldJars
Browse files Browse the repository at this point in the history
  • Loading branch information
OrDTesters committed Nov 11, 2018
1 parent 5e84997 commit 3af7d02
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

1 comment on commit 3af7d02

@toyokazu03102478
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

テスト

Please sign in to comment.