IGNITE-1632: IGFS: Fixed test which failed with small block size. This closes #590.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/bbf87df6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/bbf87df6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/bbf87df6 Branch: refs/heads/ignite-2004 Commit: bbf87df681ae0495d4240cbb5d8959b6ea7e5600 Parents: ef642e9 Author: iveselovskiy <[email protected]> Authored: Thu Mar 31 13:53:52 2016 +0300 Committer: vozerov-gridgain <[email protected]> Committed: Thu Mar 31 13:53:52 2016 +0300 ---------------------------------------------------------------------- .../internal/processors/igfs/IgfsAbstractSelfTest.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/bbf87df6/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java ---------------------------------------------------------------------- diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java index 748a771..b361d42 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsAbstractSelfTest.java @@ -3038,7 +3038,16 @@ public abstract class IgfsAbstractSelfTest extends IgfsCommonAbstractTest { for (byte[] chunk: chunks) { byte[] buf = new byte[chunk.length]; - read = is.read(buf); + read = 0; + + while (true) { + int r = is.read(buf, read, buf.length - read); + + read += r; + + if (read == buf.length || r <= 0) + break; + } assert read == chunk.length : "Chunk #" + chunkIdx + " was not read fully:" + " read=" + read + ", expected=" + chunk.length;
