You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Magnus Grimsell (JIRA)" <ji...@apache.org> on 2008/04/25 15:47:56 UTC

[jira] Created: (FTPSERVER-131) FtpLet test failures

FtpLet test failures
--------------------

                 Key: FTPSERVER-131
                 URL: https://issues.apache.org/jira/browse/FTPSERVER-131
             Project: FtpServer
          Issue Type: Bug
          Components: Ftplets
         Environment: win XP, jdk1.5.0_15
            Reporter: Magnus Grimsell
            Priority: Minor


When building ftpserver projekt from trunk I get the following test failures:

Tests in error: 
  testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
  testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
  testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
  testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
  testExceptionDuringDownloadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
  testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
  testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)

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


[jira] Updated: (FTPSERVER-131) FtpLet test failures

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

Magnus Grimsell updated FTPSERVER-131:
--------------------------------------

    Attachment: org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest.txt

> FtpLet test failures
> --------------------
>
>                 Key: FTPSERVER-131
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-131
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Ftplets
>         Environment: win XP, jdk1.5.0_15
>            Reporter: Magnus Grimsell
>            Priority: Minor
>         Attachments: org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest.txt
>
>
> When building ftpserver projekt from trunk I get the following test failures:
> Tests in error: 
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringDownloadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)

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


[jira] Commented: (FTPSERVER-131) FtpLet test failures

Posted by "Magnus Grimsell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FTPSERVER-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592777#action_12592777 ] 

Magnus Grimsell commented on FTPSERVER-131:
-------------------------------------------

Isnt it the commons.net code that should be fixed? According to the javadoc on FTP.sendCommand an FTPConnectionClosedException should be thrown if the connection to the server prematurely closes. 
However, the SocketException seems to slip through is some cases.

> FtpLet test failures
> --------------------
>
>                 Key: FTPSERVER-131
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-131
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Ftplets
>         Environment: win XP, jdk1.5.0_15
>            Reporter: Magnus Grimsell
>            Priority: Minor
>         Attachments: org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest.txt
>
>
> When building ftpserver projekt from trunk I get the following test failures:
> Tests in error: 
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringDownloadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)

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


[jira] Updated: (FTPSERVER-131) FtpLet test failures

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

Magnus Grimsell updated FTPSERVER-131:
--------------------------------------

    Attachment: org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest.txt

> FtpLet test failures
> --------------------
>
>                 Key: FTPSERVER-131
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-131
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Ftplets
>         Environment: win XP, jdk1.5.0_15
>            Reporter: Magnus Grimsell
>            Priority: Minor
>         Attachments: org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest.txt
>
>
> When building ftpserver projekt from trunk I get the following test failures:
> Tests in error: 
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringDownloadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)

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


[jira] Updated: (FTPSERVER-131) FtpLet test failures

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

Magnus Grimsell updated FTPSERVER-131:
--------------------------------------

    Attachment: FtpLetTest.patch

I tested your patch and it worked for some tests but not for all.
I then tried the simple way and let the tests pass on socket exception.
I've applied a patch for this.

> FtpLet test failures
> --------------------
>
>                 Key: FTPSERVER-131
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-131
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Ftplets
>         Environment: win XP, jdk1.5.0_15
>            Reporter: Magnus Grimsell
>            Priority: Minor
>         Attachments: FtpLetTest.patch, org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest.txt
>
>
> When building ftpserver projekt from trunk I get the following test failures:
> Tests in error: 
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringDownloadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)

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


[jira] Updated: (FTPSERVER-131) FtpLet test failures

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

Magnus Grimsell updated FTPSERVER-131:
--------------------------------------

    Attachment: org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest.txt

> FtpLet test failures
> --------------------
>
>                 Key: FTPSERVER-131
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-131
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Ftplets
>         Environment: win XP, jdk1.5.0_15
>            Reporter: Magnus Grimsell
>            Priority: Minor
>         Attachments: org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest.txt
>
>
> When building ftpserver projekt from trunk I get the following test failures:
> Tests in error: 
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringDownloadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)

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


[jira] Closed: (FTPSERVER-131) FtpLet test failures

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

Niklas Gustavsson closed FTPSERVER-131.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0-M2
         Assignee: Niklas Gustavsson

Patch applied, thanks!

commit -m "Fix tests where commons-net throws a SocketException while reading the reply from the server (provided by Magnus Grimsell) (FTPSERVER-131)" /home/niklas/workspaces/apache/ftpserver/core/src/test/java/org/apache/ftpserver/ftplet/FtpLetReturnDisconnectTest.java
    Sending        /home/niklas/workspaces/apache/ftpserver/core/src/test/java/org/apache/ftpserver/ftplet/FtpLetReturnDisconnectTest.java
    Transmitting file data ...
    Committed revision 652488.

> FtpLet test failures
> --------------------
>
>                 Key: FTPSERVER-131
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-131
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Ftplets
>         Environment: win XP, jdk1.5.0_15
>            Reporter: Magnus Grimsell
>            Assignee: Niklas Gustavsson
>            Priority: Minor
>             Fix For: 1.0-M2
>
>         Attachments: FtpLetTest.patch, org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest.txt
>
>
> When building ftpserver projekt from trunk I get the following test failures:
> Tests in error: 
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringDownloadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)

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


[jira] Commented: (FTPSERVER-131) FtpLet test failures

Posted by "Niklas Gustavsson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FTPSERVER-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12593301#action_12593301 ] 

Niklas Gustavsson commented on FTPSERVER-131:
---------------------------------------------

That's a good question, does the following patch to commons-net fix your broken tests?

Index: src/main/java/org/apache/commons/net/ftp/FTP.java
===================================================================
--- src/main/java/org/apache/commons/net/ftp/FTP.java	(revision 652071)
+++ src/main/java/org/apache/commons/net/ftp/FTP.java	(working copy)
@@ -487,7 +487,21 @@
         if (_commandSupport_.getListenerCount() > 0)
             _commandSupport_.fireCommandSent(command, message);
 
-        __getReply();
+        try {
+            __getReply();
+        }
+        catch (SocketException e)
+        {
+            if (!isConnected() || !socketIsConnected(_socket_))
+            {
+                throw new FTPConnectionClosedException("Connection unexpectedly closed.");
+            }
+            else
+            {
+                throw e;
+            }
+        }
+
         return _replyCode;
     }

Another option would be to update our tests to also accept a thrown SocketException as a successful result.

> FtpLet test failures
> --------------------
>
>                 Key: FTPSERVER-131
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-131
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Ftplets
>         Environment: win XP, jdk1.5.0_15
>            Reporter: Magnus Grimsell
>            Priority: Minor
>         Attachments: org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest.txt
>
>
> When building ftpserver projekt from trunk I get the following test failures:
> Tests in error: 
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringDownloadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)

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


[jira] Commented: (FTPSERVER-131) FtpLet test failures

Posted by "Niklas Gustavsson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FTPSERVER-131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12592677#action_12592677 ] 

Niklas Gustavsson commented on FTPSERVER-131:
---------------------------------------------

Reading some about the error you're seeing, it seems you can get this on some OS/JVM combinations in the very same scenario we're seeing here (server closes socket and client writes to it and then tries to read). Not a lot we could do to fix that as it currently stands as far as I know. But, we could send a failure response before closing the socket which would allow a client to detect the error. In any case I would find that a better way of handling this type of situation. What do you think?

> FtpLet test failures
> --------------------
>
>                 Key: FTPSERVER-131
>                 URL: https://issues.apache.org/jira/browse/FTPSERVER-131
>             Project: FtpServer
>          Issue Type: Bug
>          Components: Ftplets
>         Environment: win XP, jdk1.5.0_15
>            Reporter: Magnus Grimsell
>            Priority: Minor
>         Attachments: org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest.txt, org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest.txt
>
>
> When building ftpserver projekt from trunk I get the following test failures:
> Tests in error: 
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowRuntimeExceptionTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringUploadUniqueEnd(org.apache.ftpserver.ftplet.FtpLetThrowFtpExceptionTest)
>   testExceptionDuringDownloadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringAppendEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)
>   testExceptionDuringUploadEnd(org.apache.ftpserver.ftplet.FtpLetReturnDisconnectTest)

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