From 8becb963559335004f29fb5bdbf6e3738cd8acf9 Mon Sep 17 00:00:00 2001 From: Timofey Date: Fri, 5 Jun 2015 13:40:08 +0300 Subject: [PATCH] Working on fixing the downloader tests. Turns out, we have been serving wrong data, we wrote actual characters 255 instead of writing the byte 11111111, so some of our tests used to fail. What we will do now is serve bytes from 0000 to FFFF (or whatever the equivalent of the last byte in 47kb is), and we will modify our SHA in the tests accordingly. --- platform/platform_tests/downloader_test.cpp | 6 +++--- tools/testserver.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/platform_tests/downloader_test.cpp b/platform/platform_tests/downloader_test.cpp index f491ccfbc8..3cd243c168 100644 --- a/platform/platform_tests/downloader_test.cpp +++ b/platform/platform_tests/downloader_test.cpp @@ -433,7 +433,7 @@ UNIT_TEST(DownloadChunks) FinishDownloadFail(FILENAME); } - string const SHA256 = "338C28398CE42C1B2F6DCE2D288956819C08E64894B788250837653BAF5049BA"; + string const SHA256 = "3CE28B04BCC3006124A5324B2B145C94F6AEC613BC4135DCEF6E57C436B41B89"; observer.Reset(); @@ -541,7 +541,7 @@ UNIT_TEST(DownloadResumeChunks) string const FILENAME = "some_test_filename_12345"; string const RESUME_FILENAME = FILENAME + RESUME_FILE_EXTENSION; string const DOWNLOADING_FILENAME = FILENAME + DOWNLOADING_FILE_EXTENSION; - string const SHA256 = "91BF56C789DEFCB1F9E8EACDCB4C88C17BBC6615C24C394DF25DD2CD37B1B159"; + string const SHA256 = "3CE28B04BCC3006124A5324B2B145C94F6AEC613BC4135DCEF6E57C436B41B89"; // remove data from previously failed files DeleteTempDownloadFiles(); @@ -607,7 +607,7 @@ UNIT_TEST(DownloadResumeChunks) UNIT_TEST(DownloadResumeChunksWithCancel) { string const FILENAME = "some_test_filename_12345"; - string const SHA256 = "1654E268B74B23922FD20DC3CB7926373279770FBA7BD81B5AF25F0E2D5E0A0D"; + string const SHA256 = "3CE28B04BCC3006124A5324B2B145C94F6AEC613BC4135DCEF6E57C436B41B89"; // remove data from previously failed files DeleteTempDownloadFiles(); diff --git a/tools/testserver.py b/tools/testserver.py index aa01e49a2d..1cde252ad5 100644 --- a/tools/testserver.py +++ b/tools/testserver.py @@ -48,7 +48,7 @@ from scipy.stats.stats import trim_mean PORT = 34568 -LIFESPAN = 180.0 # timeout for the self destruction timer - how much time +LIFESPAN = 18000.0 # timeout for the self destruction timer - how much time # passes between the last request and the server killing # itself PING_TIMEOUT = 5 # Nubmer of seconds to wait for ping response @@ -274,7 +274,7 @@ class PostHandler(BaseHTTPRequestHandler): self.end_headers() for i in range(0, length + 1): # try: - self.wfile.write(255) + self.wfile.write(chr(i%256)) # except IOError, e: # if e.errno == errno.EPIPE: # print("This is indeed a broken pipe")