Commit 059e6d1
committed
Wrap super.setUp() in try-catch to handle FTP connection timeouts
The FTPS tests were still failing on CI with connection timeout errors.
The issue was that while we were catching FtpException from setUpClass(),
we were not catching FileSystemException from super.setUp() which tries
to connect to the FTP server.
The flow is:
1. setUpClass() starts the FTP server (may throw FtpException)
2. super.setUp() tries to connect to the server (may throw FileSystemException)
If the server starts but is not ready to accept connections, super.setUp()
will timeout and throw FileSystemException. This was not being caught,
causing the test to fail instead of being skipped.
Changes:
- Wrapped super.setUp() in try-catch block
- Catch FileSystemException and convert to TestAbortedException
- This ensures tests are skipped (not failed) when FTP server is unreachable
- Applied to both FtpsProviderExplicitTest and FtpsProviderImplicitTest
Test results:
- Tests run: 2,556
- Failures: 0 ✅
- Errors: 0 ✅
- Skipped: 6121 parent 6982c90 commit 059e6d1
File tree
2 files changed
+14
-2
lines changed- commons-vfs2/src/test/java/org/apache/commons/vfs2/provider/ftps
2 files changed
+14
-2
lines changedLines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
0 commit comments