Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Accumulo, mail # dev - Re: git commit: ACCUMULO-1507 - adding a (nonfunctional/commented out) test for the monitor issue


Copy link to this message
-
Re: git commit: ACCUMULO-1507 - adding a (nonfunctional/commented out) test for the monitor issue
Mike Drob 2013-10-29, 22:30
Does this test compile? If so, I'd like to see it uncommented and annotated
with @Ignore. If not, I'd like to see a more surgical comment block,
instead of taking a hammer to the whole method. Code like this is very easy
to forget about down the read, whereas an ignored test shows up in reports
and mike pique somebody's curiosity for improvement.
On Tue, Oct 29, 2013 at 5:07 PM, <[EMAIL PROTECTED]> wrote:

> Updated Branches:
>   refs/heads/master d207b9a88 -> ebbedb4fe
>
>
> ACCUMULO-1507 - adding a (nonfunctional/commented out) test for the
> monitor issue
>
>
> Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
> Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ebbedb4f
> Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ebbedb4f
> Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ebbedb4f
>
> Branch: refs/heads/master
> Commit: ebbedb4fe3cf90460e31657b5f8872a9d296bed6
> Parents: d207b9a
> Author: John Vines <[EMAIL PROTECTED]>
> Authored: Tue Oct 29 17:06:50 2013 -0400
> Committer: John Vines <[EMAIL PROTECTED]>
> Committed: Tue Oct 29 17:06:50 2013 -0400
>
> ----------------------------------------------------------------------
>  .../AccumuloReloadingVFSClassLoaderTest.java    | 47 ++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> ----------------------------------------------------------------------
>
>
>
> http://git-wip-us.apache.org/repos/asf/accumulo/blob/ebbedb4f/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
> ----------------------------------------------------------------------
> diff --git
> a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
> b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
> index f590376..06c914b 100644
> ---
> a/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
> +++
> b/start/src/test/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoaderTest.java
> @@ -123,6 +123,53 @@ public class AccumuloReloadingVFSClassLoaderTest {
>      arvcl.close();
>    }
>
> +  // This test fails because of an error with the underlying monitor
> (ACCUMULO-1507/VFS-487). Uncomment when this has been addressed.
> +  //
> +  // This is caused by the filed being deleted and then readded in the
> same monitor tick. This causes the file to ultimately register the deletion
> over any
> +  // other events.
> +//  @Test
> +//  public void testFastDeleteAndReAdd() throws Exception {
> +//    FileObject testDir > vfs.resolveFile(folder1.getRoot().toURI().toString());
> +//    FileObject[] dirContents = testDir.getChildren();
> +//
> +//    AccumuloReloadingVFSClassLoader arvcl = new
> AccumuloReloadingVFSClassLoader(folderPath, vfs, new ReloadingClassLoader()
> {
> +//
> +//      @Override
> +//      public ClassLoader getClassLoader() {
> +//        return ClassLoader.getSystemClassLoader();
> +//      }
> +//    }, 1000, true);
> +//
> +//    FileObject[] files = ((VFSClassLoader)
> arvcl.getClassLoader()).getFileObjects();
> +//    Assert.assertArrayEquals(createFileSystems(dirContents), files);
> +//
> +//    Class<?> clazz1 > arvcl.getClassLoader().loadClass("test.HelloWorld");
> +//    Object o1 = clazz1.newInstance();
> +//    Assert.assertEquals("Hello World!", o1.toString());
> +//
> +//    // Check that the class is the same before the update
> +//    Class<?> clazz1_5 > arvcl.getClassLoader().loadClass("test.HelloWorld");
> +//    Assert.assertEquals(clazz1, clazz1_5);
> +//
> +//    new File(folder1.getRoot(), "HelloWorld.jar").delete();
> +//
> +//    // Update the class
> +//
>  FileUtils.copyURLToFile(this.getClass().getResource("/HelloWorld.jar"),
> folder1.newFile("HelloWorld.jar"));
> +//
> +//    // Wait for the monitor to notice
> +//    Thread.sleep(2000);
> +//
> +//    Class<?> clazz2 > arvcl.getClassLoader().loadClass("test.HelloWorld");