As discussed here previously, starting with vert.x 3.5.0 I was noticing failing integration tests when uploading large (at least a few MB) files. The issue so far only appeared when running against mongo in a docker container or with travis ci. Downgrading to vert.x 3.4.0 seems to fix the issue. This issue does not appear on every build.
I once examined the differences between the uploaded and the persisted file and it showed that about the first 1054400 bytes were correctly persisted, but subsequent bytes were corrupt. I could not find any issues with file download. Just the upload seems to encouter this issue.
I have put a branch together which explicitly compares the md5 checksums of the uploaded file in addition to the actual bytes with vertx 3.5.1-SNAPSHOT travis available here - source
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.github.sth.vertx.mongo.streams.GridFSInOutStreamIT
Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
Opened connection [connectionId{localValue:1, serverValue:1}] to localhost:27017
Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 4, 10]}, minWireVersion=0, maxWireVersion=5, maxDocumentSize=16777216, roundTripTimeNanos=4467832}
Opened connection [connectionId{localValue:2, serverValue:2}] to localhost:27017
uploaded file md5: e875acd2c89e7db444f04c54c5b01460
java.lang.AssertionError: uploaded file md5 does not match md5 calculated on server. Not equals : 31C48A5A246C9352E0EB846FEFD0A498 != E875ACD2C89E7DB444F04C54C5B01460
Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
Opened connection [connectionId{localValue:3, serverValue:3}] to localhost:27017
Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 4, 10]}, minWireVersion=0, maxWireVersion=5, maxDocumentSize=16777216, roundTripTimeNanos=895998}
Opened connection [connectionId{localValue:4, serverValue:4}] to localhost:27017
Closed connection [connectionId{localValue:2, serverValue:2}] to localhost:27017 because the pool has been closed.
Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
Opened connection [connectionId{localValue:5, serverValue:5}] to localhost:27017
Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 4, 10]}, minWireVersion=0, maxWireVersion=5, maxDocumentSize=16777216, roundTripTimeNanos=2004399}
Opened connection [connectionId{localValue:6, serverValue:6}] to localhost:27017
uploaded file md5: b563f831734cf630117017f006470f8a
Cluster created with settings {hosts=[localhost:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
No server chosen by WritableServerSelector from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=localhost:27017, type=UNKNOWN, state=CONNECTING}]}. Waiting for 30000 ms before timing out
Closed connection [connectionId{localValue:6, serverValue:6}] to localhost:27017 because the pool has been closed.
Opened connection [connectionId{localValue:7, serverValue:7}] to localhost:27017
Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017, type=STANDALONE, state=CONNECTED, ok=true, version=ServerVersion{versionList=[3, 4, 10]}, minWireVersion=0, maxWireVersion=5, maxDocumentSize=16777216, roundTripTimeNanos=651115}
Opened connection [connectionId{localValue:8, serverValue:8}] to localhost:27017
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 6.561 sec <<< FAILURE! - in com.github.sth.vertx.mongo.streams.GridFSInOutStreamIT
testUploadAndDownloadLarge(com.github.sth.vertx.mongo.streams.GridFSInOutStreamIT) Time elapsed: 4.324 sec <<< FAILURE!
java.lang.AssertionError: uploaded file md5 does not match md5 calculated on server. Not equals : 31C48A5A246C9352E0EB846FEFD0A498 != E875ACD2C89E7DB444F04C54C5B01460
this is a build using vertx 3.4.0 which never failed so far