You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Vishal K (JIRA)" <ji...@apache.org> on 2010/04/07 00:45:33 UTC

[jira] Created: (ZOOKEEPER-734) QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly

QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly
---------------------------------------------------------------------------------------------

                 Key: ZOOKEEPER-734
                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-734
             Project: Zookeeper
          Issue Type: Bug
          Components: tests
    Affects Versions: 3.3.0
         Environment: Windows 32-bit
            Reporter: Vishal K


While runniing "ant test-core-java" QuorumPeerTestBase.java and ZooKeeperServerMainTest.java fail. The problem seems to be in ZookeeperserverMainTest.java:MainThread():66 and in QuorumPeerBaseTest.java:MainThread:76.

FileWriter.write() writes windows path to the conf file. Java does not like windows path. Therefore, the test complains that it cannot find myid and fails. 

Solution - convert windows path to UNIX path. This worked for me on windows.  Diffs are attached below. Solution not tested on Linux since for some reason build is failing (due to problems not related to this change).


vmc-floorb-dhcp116-114:/opt/zksrc/zookeeper-3.3.0/src/java/test/org/apache/zookeeper/server # svn diff
Index: ZooKeeperServerMainTest.java
===================================================================
--- ZooKeeperServerMainTest.java	(revision 931240)
+++ ZooKeeperServerMainTest.java	(working copy)
@@ -61,7 +61,8 @@
             if (!dataDir.mkdir()) {
                 throw new IOException("unable to mkdir " + dataDir);
             }
-            fwriter.write("dataDir=" + dataDir.toString() + "\n");
+            String data = dataDir.toString().replace('\\', '/');
+            fwriter.write("dataDir=" + data + "\n");
 
             fwriter.write("clientPort=" + clientPort + "\n");
             fwriter.flush();
Index: quorum/QuorumPeerTestBase.java
===================================================================
--- quorum/QuorumPeerTestBase.java	(revision 931240)
+++ quorum/QuorumPeerTestBase.java	(working copy)
@@ -73,7 +73,8 @@
             if (!dataDir.mkdir()) {
                 throw new IOException("Unable to mkdir " + dataDir);
             }
-            fwriter.write("dataDir=" + dataDir.toString() + "\n");
+            String data = dataDir.toString().replace('\\', '/');
+            fwriter.write("dataDir=" + data + "\n");
 
             fwriter.write("clientPort=" + clientPort + "\n");
             fwriter.write(quorumCfgSection + "\n");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-734) QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859954#action_12859954 ] 

Hadoop QA commented on ZOOKEEPER-734:
-------------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12442606/ZOOKEEPER-734.patch
  against trunk revision 936624.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 6 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 contrib tests.  The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/69/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/69/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: http://hudson.zones.apache.org/hudson/job/Zookeeper-Patch-h1.grid.sp2.yahoo.net/69/console

This message is automatically generated.

> QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly
> ---------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-734
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-734
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: tests
>    Affects Versions: 3.3.0
>         Environment: Windows 32-bit
>            Reporter: Vishal K
>            Assignee: Vishal K
>             Fix For: 3.3.1, 3.4.0
>
>         Attachments: ZOOKEEPER-734.patch
>
>
> While runniing "ant test-core-java" QuorumPeerTestBase.java and ZooKeeperServerMainTest.java fail. The problem seems to be in ZookeeperserverMainTest.java:MainThread():66 and in QuorumPeerBaseTest.java:MainThread:76.
> FileWriter.write() writes windows path to the conf file. Java does not like windows path. Therefore, the test complains that it cannot find myid and fails. 
> Solution - convert windows path to UNIX path. This worked for me on windows.  Diffs are attached below. Solution not tested on Linux since for some reason build is failing (due to problems not related to this change).
> vmc-floorb-dhcp116-114:/opt/zksrc/zookeeper-3.3.0/src/java/test/org/apache/zookeeper/server # svn diff
> Index: ZooKeeperServerMainTest.java
> ===================================================================
> --- ZooKeeperServerMainTest.java	(revision 931240)
> +++ ZooKeeperServerMainTest.java	(working copy)
> @@ -61,7 +61,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.flush();
> Index: quorum/QuorumPeerTestBase.java
> ===================================================================
> --- quorum/QuorumPeerTestBase.java	(revision 931240)
> +++ quorum/QuorumPeerTestBase.java	(working copy)
> @@ -73,7 +73,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("Unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.write(quorumCfgSection + "\n");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-734) QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-734:
-----------------------------------

          Status: Resolved  (was: Patch Available)
    Hadoop Flags: [Reviewed]
      Resolution: Fixed

+1 thanks Vishal!

> QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly
> ---------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-734
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-734
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: tests
>    Affects Versions: 3.3.0
>         Environment: Windows 32-bit
>            Reporter: Vishal K
>            Assignee: Vishal K
>             Fix For: 3.3.1, 3.4.0
>
>         Attachments: ZOOKEEPER-734.patch
>
>
> While runniing "ant test-core-java" QuorumPeerTestBase.java and ZooKeeperServerMainTest.java fail. The problem seems to be in ZookeeperserverMainTest.java:MainThread():66 and in QuorumPeerBaseTest.java:MainThread:76.
> FileWriter.write() writes windows path to the conf file. Java does not like windows path. Therefore, the test complains that it cannot find myid and fails. 
> Solution - convert windows path to UNIX path. This worked for me on windows.  Diffs are attached below. Solution not tested on Linux since for some reason build is failing (due to problems not related to this change).
> vmc-floorb-dhcp116-114:/opt/zksrc/zookeeper-3.3.0/src/java/test/org/apache/zookeeper/server # svn diff
> Index: ZooKeeperServerMainTest.java
> ===================================================================
> --- ZooKeeperServerMainTest.java	(revision 931240)
> +++ ZooKeeperServerMainTest.java	(working copy)
> @@ -61,7 +61,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.flush();
> Index: quorum/QuorumPeerTestBase.java
> ===================================================================
> --- quorum/QuorumPeerTestBase.java	(revision 931240)
> +++ quorum/QuorumPeerTestBase.java	(working copy)
> @@ -73,7 +73,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("Unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.write(quorumCfgSection + "\n");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-734) QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly

Posted by "Vishal K (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vishal K updated ZOOKEEPER-734:
-------------------------------

    Attachment: ZOOKEEPER-734.patch

Request for review.

There is probably a better way to handle backlashes in Windows. I tried a use properties (file.separator etc), but didn't work. So finally decided to do it the dumb way. Replace "\\" with "/". If we done replace backslash, then java considers it as escape sequence and essentially the backslash gets removed.

Please, feel free to drop the patch If there is a better way to handle it.

> QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly
> ---------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-734
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-734
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: tests
>    Affects Versions: 3.3.0
>         Environment: Windows 32-bit
>            Reporter: Vishal K
>             Fix For: 3.3.1, 3.4.0
>
>         Attachments: ZOOKEEPER-734.patch
>
>
> While runniing "ant test-core-java" QuorumPeerTestBase.java and ZooKeeperServerMainTest.java fail. The problem seems to be in ZookeeperserverMainTest.java:MainThread():66 and in QuorumPeerBaseTest.java:MainThread:76.
> FileWriter.write() writes windows path to the conf file. Java does not like windows path. Therefore, the test complains that it cannot find myid and fails. 
> Solution - convert windows path to UNIX path. This worked for me on windows.  Diffs are attached below. Solution not tested on Linux since for some reason build is failing (due to problems not related to this change).
> vmc-floorb-dhcp116-114:/opt/zksrc/zookeeper-3.3.0/src/java/test/org/apache/zookeeper/server # svn diff
> Index: ZooKeeperServerMainTest.java
> ===================================================================
> --- ZooKeeperServerMainTest.java	(revision 931240)
> +++ ZooKeeperServerMainTest.java	(working copy)
> @@ -61,7 +61,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.flush();
> Index: quorum/QuorumPeerTestBase.java
> ===================================================================
> --- quorum/QuorumPeerTestBase.java	(revision 931240)
> +++ quorum/QuorumPeerTestBase.java	(working copy)
> @@ -73,7 +73,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("Unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.write(quorumCfgSection + "\n");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-734) QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-734:
-----------------------------------

    Status: Patch Available  (was: Open)

Thanks Vishal, appreciated!

Btw, once you have a patch that you think is ready, just go ahead and "submit patch" on the left hand side (link).
This will run the patch through the automated tests and advance the workflow (so the committers will review,
perhaps provide feedback if changes need to be made, then eventually commit).

Thanks!

> QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly
> ---------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-734
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-734
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: tests
>    Affects Versions: 3.3.0
>         Environment: Windows 32-bit
>            Reporter: Vishal K
>            Assignee: Vishal K
>             Fix For: 3.3.1, 3.4.0
>
>         Attachments: ZOOKEEPER-734.patch
>
>
> While runniing "ant test-core-java" QuorumPeerTestBase.java and ZooKeeperServerMainTest.java fail. The problem seems to be in ZookeeperserverMainTest.java:MainThread():66 and in QuorumPeerBaseTest.java:MainThread:76.
> FileWriter.write() writes windows path to the conf file. Java does not like windows path. Therefore, the test complains that it cannot find myid and fails. 
> Solution - convert windows path to UNIX path. This worked for me on windows.  Diffs are attached below. Solution not tested on Linux since for some reason build is failing (due to problems not related to this change).
> vmc-floorb-dhcp116-114:/opt/zksrc/zookeeper-3.3.0/src/java/test/org/apache/zookeeper/server # svn diff
> Index: ZooKeeperServerMainTest.java
> ===================================================================
> --- ZooKeeperServerMainTest.java	(revision 931240)
> +++ ZooKeeperServerMainTest.java	(working copy)
> @@ -61,7 +61,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.flush();
> Index: quorum/QuorumPeerTestBase.java
> ===================================================================
> --- quorum/QuorumPeerTestBase.java	(revision 931240)
> +++ quorum/QuorumPeerTestBase.java	(working copy)
> @@ -73,7 +73,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("Unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.write(quorumCfgSection + "\n");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ZOOKEEPER-734) QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ZOOKEEPER-734?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12859684#action_12859684 ] 

Patrick Hunt commented on ZOOKEEPER-734:
----------------------------------------

Vishal, would it be possible for you to submit this as a patch? see:
http://wiki.apache.org/hadoop/ZooKeeper/HowToContribute

> QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly
> ---------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-734
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-734
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: tests
>    Affects Versions: 3.3.0
>         Environment: Windows 32-bit
>            Reporter: Vishal K
>             Fix For: 3.3.1, 3.4.0
>
>
> While runniing "ant test-core-java" QuorumPeerTestBase.java and ZooKeeperServerMainTest.java fail. The problem seems to be in ZookeeperserverMainTest.java:MainThread():66 and in QuorumPeerBaseTest.java:MainThread:76.
> FileWriter.write() writes windows path to the conf file. Java does not like windows path. Therefore, the test complains that it cannot find myid and fails. 
> Solution - convert windows path to UNIX path. This worked for me on windows.  Diffs are attached below. Solution not tested on Linux since for some reason build is failing (due to problems not related to this change).
> vmc-floorb-dhcp116-114:/opt/zksrc/zookeeper-3.3.0/src/java/test/org/apache/zookeeper/server # svn diff
> Index: ZooKeeperServerMainTest.java
> ===================================================================
> --- ZooKeeperServerMainTest.java	(revision 931240)
> +++ ZooKeeperServerMainTest.java	(working copy)
> @@ -61,7 +61,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.flush();
> Index: quorum/QuorumPeerTestBase.java
> ===================================================================
> --- quorum/QuorumPeerTestBase.java	(revision 931240)
> +++ quorum/QuorumPeerTestBase.java	(working copy)
> @@ -73,7 +73,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("Unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.write(quorumCfgSection + "\n");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (ZOOKEEPER-734) QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt reassigned ZOOKEEPER-734:
--------------------------------------

    Assignee: Vishal K

> QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly
> ---------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-734
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-734
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: tests
>    Affects Versions: 3.3.0
>         Environment: Windows 32-bit
>            Reporter: Vishal K
>            Assignee: Vishal K
>             Fix For: 3.3.1, 3.4.0
>
>         Attachments: ZOOKEEPER-734.patch
>
>
> While runniing "ant test-core-java" QuorumPeerTestBase.java and ZooKeeperServerMainTest.java fail. The problem seems to be in ZookeeperserverMainTest.java:MainThread():66 and in QuorumPeerBaseTest.java:MainThread:76.
> FileWriter.write() writes windows path to the conf file. Java does not like windows path. Therefore, the test complains that it cannot find myid and fails. 
> Solution - convert windows path to UNIX path. This worked for me on windows.  Diffs are attached below. Solution not tested on Linux since for some reason build is failing (due to problems not related to this change).
> vmc-floorb-dhcp116-114:/opt/zksrc/zookeeper-3.3.0/src/java/test/org/apache/zookeeper/server # svn diff
> Index: ZooKeeperServerMainTest.java
> ===================================================================
> --- ZooKeeperServerMainTest.java	(revision 931240)
> +++ ZooKeeperServerMainTest.java	(working copy)
> @@ -61,7 +61,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.flush();
> Index: quorum/QuorumPeerTestBase.java
> ===================================================================
> --- quorum/QuorumPeerTestBase.java	(revision 931240)
> +++ quorum/QuorumPeerTestBase.java	(working copy)
> @@ -73,7 +73,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("Unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.write(quorumCfgSection + "\n");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (ZOOKEEPER-734) QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly

Posted by "Patrick Hunt (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ZOOKEEPER-734?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Patrick Hunt updated ZOOKEEPER-734:
-----------------------------------

    Fix Version/s: 3.4.0
                   3.3.1

> QuorumPeerTestBase.java and ZooKeeperServerMainTest.java do not handle windows path correctly
> ---------------------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-734
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-734
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: tests
>    Affects Versions: 3.3.0
>         Environment: Windows 32-bit
>            Reporter: Vishal K
>             Fix For: 3.3.1, 3.4.0
>
>
> While runniing "ant test-core-java" QuorumPeerTestBase.java and ZooKeeperServerMainTest.java fail. The problem seems to be in ZookeeperserverMainTest.java:MainThread():66 and in QuorumPeerBaseTest.java:MainThread:76.
> FileWriter.write() writes windows path to the conf file. Java does not like windows path. Therefore, the test complains that it cannot find myid and fails. 
> Solution - convert windows path to UNIX path. This worked for me on windows.  Diffs are attached below. Solution not tested on Linux since for some reason build is failing (due to problems not related to this change).
> vmc-floorb-dhcp116-114:/opt/zksrc/zookeeper-3.3.0/src/java/test/org/apache/zookeeper/server # svn diff
> Index: ZooKeeperServerMainTest.java
> ===================================================================
> --- ZooKeeperServerMainTest.java	(revision 931240)
> +++ ZooKeeperServerMainTest.java	(working copy)
> @@ -61,7 +61,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.flush();
> Index: quorum/QuorumPeerTestBase.java
> ===================================================================
> --- quorum/QuorumPeerTestBase.java	(revision 931240)
> +++ quorum/QuorumPeerTestBase.java	(working copy)
> @@ -73,7 +73,8 @@
>              if (!dataDir.mkdir()) {
>                  throw new IOException("Unable to mkdir " + dataDir);
>              }
> -            fwriter.write("dataDir=" + dataDir.toString() + "\n");
> +            String data = dataDir.toString().replace('\\', '/');
> +            fwriter.write("dataDir=" + data + "\n");
>  
>              fwriter.write("clientPort=" + clientPort + "\n");
>              fwriter.write(quorumCfgSection + "\n");

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.