diff --git a/tests/integration/_expected_requests/debug_files/upload/chunk_upload_small_chunks.bin b/tests/integration/_expected_requests/debug_files/upload/chunk_upload_small_chunks.bin new file mode 100644 index 0000000000..326c8b5929 Binary files /dev/null and b/tests/integration/_expected_requests/debug_files/upload/chunk_upload_small_chunks.bin differ diff --git a/tests/integration/_responses/debug_files/assemble-chunk-upload-small-chunks.json b/tests/integration/_responses/debug_files/assemble-chunk-upload-small-chunks.json new file mode 100644 index 0000000000..46ad1ef8e4 --- /dev/null +++ b/tests/integration/_responses/debug_files/assemble-chunk-upload-small-chunks.json @@ -0,0 +1,636 @@ +{ + "6e217f035ed538d4d6c14129baad5cb52e680e74": { + "state": "not_found", + "missingChunks": [ + "39aadb58cc14644c975f1341ab6ddfe2107d7b02", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "d9ecea0a22d4a834e2793b45cb86f0c7fbf0f920", + "aaa4a809a0f57a0442245f46472d51cd65b1eba9", + "1d3dae720c27c78abdf96fd0148b7a845e4b5916", + "fe724fe463aac5c4c92293ffeb8d9365a3b4478e", + "bde3e7324116132896fcda47100546dd56cf171f", + "7ab3739d0c131805d3747c4ee1496cf0aedb38a3", + "ec0bd6b9f7645904d903a816958eae8799cff1b5", + "bbdb1cc4b48fac0a42090791256e962f5ac6abe0", + "b004b82bc8886e74d697a854e1f23ad63c6fe0da", + "b5caada9ac4da11b13f5346513f316d399e17924", + "22daba7f39e70e0fbd994a9594a6a5974e04deb9", + "bfb844ffec884f64e1ea7d66d95c39986d825d9e", + "73945a93cc1a002433e0c580351044814ff87db7", + "c07a8fd120f2e909931187d6631db78fb061f2f9", + "c6ae786674b7c4e94df46f811175a53525be3f3e", + "0e61b87d2e86ef7ec23786309443884b9eb06bb1", + "6f325c6cd30c6eec4a4d119e466bfa73fc59039b", + "2017365d440780481db00305d81cb7394c459b6d", + "82204e747f036009614d436da660657ebf70850c", + "eaf5704666e0d39fed4a28cc7ad8e86b5388f3b3", + "f9421aaad9a94eb76910db2f11d2cfea466b68e3", + "8cb5c1b7a698bf7215ce17675992fd8fad6e2694", + "22c2cf0c8ce1e5184c5449650e3973c52b3781bf", + "e82c992b0c0f5226532dd795c6be4e18d4cb8ee4", + "2697cec4b772f50e72e747ac1807e54fe3c22224", + "93859f9b3e602a8e3e69e968078a75e1b70419ae", + "271147f50e92d6f96746107455d07551ea5dcbca", + "10416fb4e5c6eed0c4179547e7fd19bce48ee97c", + "a396d6949fb3426f9d5c7acaf9c1cdf2e06b708d", + "ca2f932b9d45d7ae40426fb80ac7ecf46aee3309", + "3b7fde80fb14be9e5b0b4eca455676110fd771df", + "e8a4d3023af5c288e99369c05935a24bcc69ea45", + "e49c1bb8f8458cea7aaf2a9fd8cb74fce8806d80", + "6745eead28aefb02371e97557ed0465ec758763a", + "f0f9c5672231d9b497fd3d92f17b5b170cf78733", + "ac7962a7e7a1680dcf42cd66e2f78e9def4573aa", + "dae6b6055ebe0d527d313f89c713aeed0b1dc511", + "963dce2433e8888fa82f24ffb6aef887965b3717", + "ee2582c1ea4d53c6ff91d8a562d201e670d1832b", + "ab3faf595e53ec936a4e3b37c6ab75273a0311c7", + "4ab49169c49ab809c910285b56fec455ed8df4d8", + "de8df3032009c14108976d9fb0b1d8084f364781", + "c2a44b5e186e5322fbed825ebc0e194f09c8e88e", + "63816cbc7ba93bc14f77941f3525695585f0102e", + "1e0f2c5e74780618f9977859d5f3c401a95d1cdd", + "d707334fe0ee1ea2b097ff4774418f01a44ceadf", + "569c0c9c67efdb5be683a6176bd426678195ca0e", + "f12c4763378a454adf20f84111500784fc33bb69", + "759bd2e24ca88198f6d3661faefdfda1e09e1bba", + "88b37439d8c708a0ec5c770ce38411d4641ee0a2", + "ed4b467836bb9391ebcad2b070cb67739f95be2c", + "dc89d35cc1f4a186774aecf61692dbe944e8864d", + "6b01a43a949800c46aabdb13c1b0c08e584d2510", + "bcf0c2ca83e528aad99a8b10a264630037c7d8ac", + "9a7ec82a16b2d69bfeb0beb5a714a1e78bb994fa", + "cf88574b00edfcf99eaf0760ece0e44cb6182b1e", + "2cc1cd085b98714595c35318631ffd1db3c06dee", + "a917e8484ef12e28e2992a321ce371e4cec1bc7e", + "0268113353a5ad25177fd5e3b91512828ec92242", + "1b0343bbcd2da9f4a77f1081074082f827da16f0", + "c62275bca5967553643f5712b3b632e37593444c", + "f3d3ab8ed5b0f506f1faf9bb38183ed7b12c6d06", + "cc583b18e8a299c7a80e2a7d8faf5d22f2717c38", + "27030b1b52d6a0160b79bb8200d72f3e50e4617e", + "3ec2c4645890c7dad73058ad817057a6f91a9c58", + "dc320d1f19b5e952948423ac6bab5a6116e9f686", + "24e22af123a808e5e45640854d96fc70fb57e688", + "404f94ec9250885f31dc06e1ae6647783d8ad684", + "9c636ebdda3993b576d9d52dbf8bb9a9b2285b1e", + "e2231624de4be8432ffe96f1e3653b9ea3b2c331", + "51aeb6793fd95f69648d6fab828e26e4a884e4e2", + "c36fabc9a9a3cc4ca0512b09d1e9195f4a5ba0ed", + "377ebf00ebc05da29b10567d5151ec68d0f892ac", + "d7e4a829983859d088db651d870465fca41e13da", + "30001ee593e5a51cc9f3a2ac9d18a24a02dd695a", + "da7d080b845eadb6952c894d0485e1489a257693", + "66cf965467f9ca94a78a8454918ab575e202a11d", + "1251ed6f40f22ce3aaca95d691ad28a160b72821", + "d0146cf22daf0f33e23ed49cc09bec1221fe8d5c", + "b9f1ebef159ffaed6d8ec1138dbd25471d4c4922", + "833b04c9751c7311a10d52a2ec05ef441060c918", + "32c17c139af1c3fc1683e4d955c2bd9130b61432", + "08ff541930a355a97a5c84a44b05a7b9e14e60eb", + "eb2d01d729f38b3936ebdd9d3285fedf3cd7ac83", + "32c43888b3ec9cdf7eff8e7f4c44709d150b5655", + "2d2275b0e1bfcd378e7ef787afbdc7a696c1d0e8", + "6182584a25511e634839060aa83cf1422446559c", + "51d24324d1752e5a9a45c837f0006f929dc0cdac", + "c7ecd485788f99a9ff3bf7999fb014c0414e1a59", + "abe4c7e36a47273a1a61a6c4409cb6e637197480", + "084f98355efd9e78153297dd9d0a6b888a312fbc", + "9d94e1eb926e8ad196ac4f8f2588bc7f5bacc830", + "a75ca630a47c77bf8f4c03cd4a95714b6661f34e", + "00b912d4385df7c5c919a5a4b46faec4a050bc17", + "9141203f3397a1020f5329d0d3a6d466becaaba2", + "9277bf1cb8007bd18d875a32ca7d8f72568fbcaf", + "24b1d3555075566e181f65026dce68530e6e3f57", + "375efd44dca4a09aacd24cdc28d47ca64129b9ef", + "13f0336efd0d545af4bacf6001e8a9a925636f2f", + "81c4f20030ebda480ddddc47e5773a2f4303f310", + "9f0f0170856dd3569bc097cd1007497eaff995b0", + "44981be3a512acc34a18a3c9da6b04f6cb08b714", + "b038cfe591fb0dcef39923513a20beb560c3a158", + "27942978d4eb572ca4fd11286ee54ec02c460253", + "eae04176662cf5106bbd8f816b6b442802e73ab7", + "a02e212875ef8bce0913d11d9a07ed30a397aebe", + "bb1d7edf1635489191bc56cbad8d045c4b0a777f", + "c5aa05e2bc2109e5a963d1deb070cab3adab1ec0", + "095246b39ce3ac6d838a1f855d2118976afa4311", + "92569a5a822955df76c94e1e51b230d3f9e6d4e1", + "c9ce0364355abb085be4eb5809f6142cf2473a6a", + "e269fda7fa54aebbd5b302bfe90ce7b8678b617f", + "d8082f5e9895d6525d4bc82a67603159ca879e23", + "b29dce46d53bc3760743878c24c77ea92d2e3e49", + "ab98d833beb90f929e0f6e63a3bb2f6c2d2cfe53", + "7a40392092bd99a8e273249d3182c74e307ef3aa", + "82477e8dd17c820e360a8a7cee0fc335e0abaf06", + "862619ac2605622a4a1425b94e569218dd8f4ae7", + "4009d52f576b5f73e77814223b8c684e2557bc26", + "f64e211cee2952fbea94932e5f2dede21c057c86", + "2175c54f27f8537a7e3e45f4d37efe3481f869c7", + "0ffcd570d7e637ec1548b503a66344fa19479557", + "5826d8c84284cb7c49ffa9dc0e6f2138fcdac553", + "4ff3b88d2e76d53b426793fd495d2d86f25438e2", + "36cd5256e8dfb1738b7ea6fb5f2c688c55420f51", + "cc928cbe93e15a7b4452f3bc7b019bc5b7bf4e2a", + "2cfe3d749b23c19ea2adcb5fce27f2d25c662dc5", + "cadcabfaad1eac6d097bbf0f394ea4fa1294396f", + "42bd9a872f1b0d83d1fbe76a3dc59ffaa3dd555b", + "f853d4b966b005dd3f302d3e17aad968b235b83e", + "107d4ea9cddedb9292d475bf0f85bf45d3de29d6", + "4704b3451354381731660fc5825aceaef2757150", + "018534951a56d6e5e095fb3721b6f95fab3026f2", + "31096550e21e5628cf2ed97bdafb52c2fcfb3133", + "4ee5b846482141eca90297f5baf23160cb24abff", + "25ed234018fce3e311259aa4ad7f9d9d4d97edc3", + "7b634e3ed42be766e09293e24a65ccb3af4de420", + "8ec296beb2b06caa57be4a65a472cf2abb22d54f", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "9cc6aecea21497009f876b268bcfb4bed415dad2", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "1ae20d28ea0b35e3c0a4e9d2ae90869295e3e8b8", + "493b5ddb3e2e6aa1d0b17faf048cc2a2e0ee4087", + "a0e261f377fd69551843532de8f4ebb1863022eb", + "1231fac07208f2c9cc5427e65f30924601a6fce6", + "12b8cd9ad15deb7b73e8768db50a6176f8b46351", + "a47115a6547f6b7d03eeafc7ef74f94c0dfbbd56", + "37578666f1080a189248c6337b718650b7cb7604", + "6002fb5a1af324592a3e266876c30265152cd58f", + "ec563f5b9ac06354211123c813f6568d7c1e75ca", + "d87275b087c0be45e6983469821181ad6ce98bb0", + "36391d9ad98523da794eebfac2605a0960ab653f", + "500f3e10bfbd48c67fe73801c0a4b090162e58e6", + "e0086a0befaea2be536a89400873b6d676c83253", + "f27e93ad6b00e4582d74be220c7e4d70447edfff", + "04e7120c6798a428d9ac9614fa7d7c50d1a609fc", + "edb262c2c5917ef07799388d6749e800dcbb7a61", + "3692c696ebbc9267e9628af59551b5f57dc3b3dd", + "0e34e008efae378b1cdafd1574796ab245f0b9cc", + "062950cafc9868a77475527151f25997780f28cd", + "e47a143c439b0d3a1119f5c767df3c8848411b30", + "343b098ee65ebf9cb2ad727243b5f9ce5d4bb1ac", + "156f077fca451f4a549a0c60d8c0350b3a46d7d4", + "892265815528c0be3566f2ba3c5e4536c0fe21fa", + "a67dbf884584fd2c4f86675e49b469ad26238f53", + "b9e4a45d3e9a5010f874339ebaec97e5ba52f3be", + "0b1359a139e48d7cec5226755bb19a430e6cba08", + "40ff3398cee25a79f9d3be463f9f51760cf2ea71", + "6611146ec6d7b0f7d66b99da9b55a65145f270b1", + "6191cca73478f16def51dcb112a6a19fd28bc892", + "d864739f0eec548ee2be435f424bd9c6e04a93ff", + "cf408b3c6a8f61f2e5f5f8a4d9831f50d8aba694", + "bd86c428063a7dcb32ec4c211f361eeffb1e9c2c", + "eae645aeddd641bf831ae75a4b812ef9a4e6648e", + "09f5ccfa1416e24984571f4a87045edf2ec0f99a", + "412654ecf4e6424c66c935eff037fe9ced0ea6af", + "0bde079ac5b47f0273ccad81efe59d7a63da1e1f", + "a7cdeacec062c748829f2e05ee5adb40ca002ab4", + "3c0c4922aef5525d17ed4622777bcacd6f5d444f", + "dc2fba7681a3f94a10a32d557d146351945c781d", + "f0d5b1a1c48702aecc9e8ee926569f76b04d721f", + "3c3141a8168a37fa116757473f1f2a5d9b8fe921", + "d9bc44fe94dabba25c628307b53b168295bb216e", + "18b930d86ca27855ef89499b7467002375133a32", + "dd600a94903491c51b4abe15efba0ef7a92b9e3b", + "00bd97199bda980d8342d465a5c910a954508392", + "a94848ce550ff0ac424878ed39f07ce0dcb07627", + "1b99d14e42ad8fffcfe11f5cec375515e1ab8ff7", + "564b576531c5aa0fd8653ff88319c2413281ba82", + "aa732a33845f25ba1c17ac23b5e72f7c7e13ad57", + "49631910bfd74ae32119abb57306907b3d18016e", + "eea27ad6862d68047ab15c91fc25653043196157", + "c6a34f161af68f9886739615f98e8aa2af287a16", + "cb19dfac64931ae4fe389e16ff2ce1d1b0478a7c", + "b4dfaf16e623e36479b804d33e7267a89283da0b" + ] + }, + "500848b7815119669a292f2ae1f44af11d7aa2d3": { + "state": "not_found", + "missingChunks": [ + "99654bf5f8b7960080239edd98d3f8330b710e3b", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "547c1456af1721c219f3e99fc9bf9d125ccab449", + "a1dc610e26fe9a8a890a32e173cc99caef171593", + "50bdc42d0de22adeae5300b04118db96878aac9c", + "1b8e5174d3d37a9de970b4134d2245ff056dbb2a", + "63277f9192a37fd3b08a1f744376cecbbb1f1360", + "88e8fdb81e99e6ae0620cc2e91e3d46b7a295332", + "160ac94e2d3ee3dc0deda35448ee8f711b518a15", + "e223cb292864e481cf5a05674bd4446d5a552bda", + "547f61adfcd928b73d62fa618a445d0bb520d90e", + "c92736bd0197fd728d1e73b4b2030440c7d560f6", + "1697c9991572a0f511725d6578738487aa0e4ffb", + "2ad4c4c619169e652b4e16715deb06476a3b894d", + "316c745806e711763659779618a1f3cec60e1707", + "2915ed7f42c7cf3ad4bae07f87771809cf1840fb", + "dafb68427d51ced029b75f097db7b310c9d87dee", + "249dbe60ff88522cda07faf52b2ad5aee33e1005", + "5eea180bab81285c9c3da2e61438e6c43db87472", + "3a3ba96b20cb82002700bc3982a9e348d8dfdd72", + "2d14072721ebabbf1b14b029deec6be9c693b1cd", + "5cc6fc6d7c755711be68ec1fc1bb45add82ce16a", + "5233bb99d792299a494b3701e99242d4d3fa7da7", + "bfc41e3c0145bc352668201ecfe6c914072c529b", + "7033f4077b70555d4f7b267ca4ff861150c53fce", + "2d0023fa20e9bc2638873cf01d157d1e41d0fffd", + "016143048d3c8ced57cc70d86e27adbb8d883803", + "8d6255deb7ed468ea53d6fb13df37df6713a9dd6", + "81154d2b13fa886a98ca9292b24bfc67fd34df4b", + "40f3a4c8ea51ab08ff0cc97c9cbd837ef6a50710", + "6956ce77225a3f0f9d6ed7f229439999bddf9146", + "5abcaead64bf2a4563ef0b44cc7e742ae4f79b2e", + "81524fe53c93d5021c858f3abdf16ca77daf3f8b", + "c09d2f0421122442929fa7b55697315a625ab31b", + "83a80f3f74d205855dd6e2555f523785af5e6b31", + "50cfef079f29510c6d6f0e3df3b16909fb785940", + "c9e0612fe0c3756e5b0a99932fad97c853ba8e17", + "1d6afbb731377fc91210f0d8b98513e3e7144583", + "184f883117a6613ad7d9a016ca4b3200e84607cd", + "428ab81c14d67f6f8a42155d0e49599418a841e4", + "0b97b8064a4e7b574a6c1aa5f974252ec5a623d8", + "fbafd39187b674914e9da76c9159bff5134d4f4d", + "ca8ee2a68f3ca9fc67729ccd0316ba010eb89ff9", + "64b2d819c141a601fccc45e8ed24a2f69be01e06", + "e974bcb370f1200885e7b48ccbb69cdfdd258a4e", + "4b6cd7cf7bb7b66ec0856a8238b2b1f7fb0311b8", + "868cdce764c2afd099d8f352cc0cc79b79f41bd2", + "5a19ab3f9f1e86da37049e79f4f0c75e97beda1b", + "33384056b10f3669b923dd472e245cb440537659", + "f2df455418cea5843af79e58c52f8d95c7494028", + "4c339e4300c35e11867c3e4a8441bf44e0e8a6bd", + "937ef1d2fd2d51eecbf947c50df577e00e104fe4", + "91ab378c2a1dc0242ca034d1c141ffc0de499c04", + "8add7dd1c9378917eb60329854c6ac6cdf49f206", + "efe3f303fec95f49073078a38e25be3578a83875", + "58ac10e8127885c5376d6492e13141663fc430a0", + "70b4d096ef8f8f4c3df8692ac2c6df1c7f57ae16", + "95aeb881b97411c281c0fb5ff29ab9d2f7b643b5", + "2c5e3a2b69cb5010fd2d0360710dfd16bb6eb6f5", + "ffc3ce903ca544f675d06de5a09d8c6513e6047a", + "438e77d785888e9dd55857de910b8cf58542a2ca", + "72aace803a02ca122f01f56959452fd9e4f0d22a", + "a868da6e5184f43d369c5ecd12ff3abcbd85a225", + "6e4a5a9281c8651da28b3293f4f73766ace72439", + "8cf7c2aac8cd67daf34fbabaca31f0199b08a903", + "426b83c3d75dce025192113aa97bd521363403e1", + "b6a605e1bc5ef716fbbddb2ccbc203167dc912df", + "046ba9d89a91bc1e6bf4edefee238450e76814bb", + "51bbe2405a2f902a2adc1602d27392d8b2070bf7", + "5f0222e1304507090f5b580eb3f7ab0866f77655", + "a2c9676e4ab11b0971c2665b5665fadbb5544ac4", + "970638f85b607d9d65ed32982c6cee3e3465ebe1", + "e10adc7036b555554df0f5c013996a9a55d3972c", + "554f95e8b24a709e1b9220d44368b7469da595f4", + "dd2454fe0c83ab67fddf3e9452eca23d63faae67", + "6fa47e9ff67f8b93d7e6a0e226ce9423cc3961cf", + "cc20a9f74db79a5c776ce1a33061ba781f44f140", + "79d358c0c7848c51d4ced74547b0d22ddf26101b", + "ad90fe15cdb5101d7d43fd477ff613580c7fed6d", + "b1cb5b930fe038f2c69848463f37c8af99ee341c", + "99de5f1e541c3f7153a5eb499e78e926c3efd865", + "c55b67ae39a165a0a585b039b618d7a5f29bb9eb", + "9e261549d8d667701f5575d76d1ed950fcfa75c8", + "9dc24815a3999e23470c466e3341e77badae1325", + "198b3e8a75ccec33c9f80489bab60ebb2c2046cb", + "3e11bfda9c98d6ace7b7459cb03c69a0e4492650", + "f3a189e4ea26790356b3ab1831a717958949c72e", + "d8c00cbba40478828ff96fdbc51a555bf25c19dd", + "eadf3ee12ace8de812ad29d1b0ee76166a6bd125", + "ad5cbaa53d8c9934e4a4e52a48a4a033d850364a", + "e3c3729600a1c39560ec6e9361c6cda3cf0d8f58", + "a3e290868cf6dd431cee7880730d7ef071390fe6", + "9c40bf2c7b57ea6eb3197ec0bed19fc244a49299", + "81a68c0cb33c8dc0215bbabeccfb960af87e54fc", + "0acc9d96c0b2278e22b7e9bc6a5bb647fa4e8a05", + "f3850781083d6bb592f4a460c5892e8800490bff", + "e8fa95f23daa2dea75a328c03c61e160850825e6", + "377db7701edf81f93aa958be61f6aaa9faa72f6f", + "47bbb1181484e136b7f43eec7d29ac1ca92bd863", + "37f67bf6252b40e2fdf41f4cb4e962ccb7e607b9", + "0f6c68df7a65bc450c698b81e25e47d34c3c07dd", + "75e8a2c4eaade8c530a3d4f830420dcf2a5add75", + "39985b9f4f506eca8c5489e9aee724c37134f37b", + "1e53d233f36067d9684aff28e8b56e481ea678b9", + "5a2cb5ecb6f31ad7d89d88ba57e8ab2dccc252b0", + "dcb5cfce0df870f0436b1952ba497cd88a1ae78e", + "e7f2c46b57b12f4df2f927cfca164a38e168b966", + "ab01733751234fd2ed67645a31d9b1640bec9c3f", + "e58af3605189aa52547f10498e5b037c084faa59", + "ff298717d4858c07b80cc9d92b10f29614698d31", + "9ec27d1ce421df315ff269bc21a699d3712a796d", + "a4db38ef5474af0d9cdfdec77e39454e115bfec4", + "cf2101dd26764e083ef0629c6f3b7977380c1195", + "2104dea0c8fb437510f0df54f050786725390165", + "e1d8219830242fb037ee33de21fedd5f6df5e018", + "c8bcc8bd6a5a733ec63d7687fc38b502d7e19cd2", + "7b492c0832fc6f68c5f6b4f648095ec5d7a79f4e", + "8366fd4f7d3a10d19a2a4c532477db0798549e52", + "e7e9f956c3a1d815773135d6863ac10a9b4f983f", + "3c9a94dc328eafeb39e91915f5830a8dd5c6793e", + "2d55e73ccec27d66eb302b673a0aa1a5cfd11b39", + "3d48d688e57593e4b6b24537e4722ff583ad3c21", + "4d000f6f802f43000f4f337ffe4268e042c595d0", + "fa22ebca31f2d52767145e39deeef7913df1b57e", + "5d55a89c09fe1bb51b8da90b1742ae356626c131", + "9d061505bafaa25eb8c4e352b120c3691f6e97f2", + "31e45b5092363e16eed554b9eafb2c75fd2249a6", + "b69aaeb4431f2fbd81c28a9d1d1cee0f932dbfff", + "407320c01554490f1bd0d34055c90ff98a909959", + "e979e0e86e38d21d77cb19b8e32de63f9e87d6bc", + "e39b40933eabca9d00a020cea4f2052cbffb0df1", + "7f75d8a001a5e31164b854f2fc45908ba7bc69ec", + "6b094930798ec0d27ed5dc984a67ae7987b80805", + "6ed73fe6329997cf3e005b1982896cc2db5fd89c", + "6447bdc592753ec0c9bb26b9450d2c88be57f40c", + "1fb71c06d3a630af3c5b1b3ed2a0c917bc568e51", + "c998dc4c67fd2db9e516e12e22eca5e533fab346", + "710de0182a7466cb6bd375f2bca5316894e09f7c", + "ec039dfd1a086cbc5e67d716e2195665af15b6a7", + "fca0a3e10ee7bd466a588a4988afb841d44a8254", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "9cc6aecea21497009f876b268bcfb4bed415dad2", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "7995729ea2f92cd667ea7de9a3213d61482f4c9d", + "efe7a87fa31f4704be941d1600febf28ca546782", + "bcb4bcf0e3bef8a12ba5347e2820639cc5ade4f0", + "6a0f41948b5b7a7342ec332bd8804acafa7b048a", + "4728d857fe6b6d6345aeeee52f0940e2a3388074", + "d61f19433cd72480e79b787c20f7c8e562173b87", + "e87cecaac8b3a53ac7ddd5208f59c2dcce79ee9e", + "ca1b100a3c2de8d0746a6f182a1176d68008e2b5", + "50560fad3b55a16489bf45162da566528600edc1", + "e59dd7e5709d8aba454d83e870d265eb060928c2", + "af5950de5dc408189fe1713691fb9c59f9c14b00", + "69292cde395de98d1f41989adc6095d47a345f60", + "7414d47dfdbc7492366296e1c67f3f1976a67f11", + "977ce576f4a4fb8783bce8d25c3f4c97ff970b9c", + "cfe6f6b51ba064fc418405e37bfefc26a6913f41", + "de43bdf5b17e3dbe3f310d30ebd944d637dcff3b", + "fc0d4c97cfb19c479192c0cc787a93b09b0cf8a1", + "269d52efbb49d17a6ee52ad1dc95f3b1533980b2", + "e67718982a9589d91ed30250ecd2777b9cdb2162", + "47228e8bf39d9bcf0fc26c41a7ac64c7ee17abd7", + "76d94bf029f5efb6e4e46028ae7a6258510cd3e9", + "ff3111dd95b51c88369bfa10d59ef3384c474081", + "95b13859036064c3db8881260b60e7940520049a", + "bfc920ef2cbdcc24020a8cbe9d9a5a3b7c2bd6d4", + "4fb994c80da39f4f6fd0ff7f635e68ce08723210", + "592bd37efcb66e800276b712019ffc741b6010f6", + "ad456c0601f322ffaec228308289e38baa1892fd", + "47c2055f4d4d8ec7e4ce563ff1490ea3a705b9e1", + "b8126805b586afd886de92120aa4e24756f55a81", + "a47926fbd8423a68815cd4d510ef03ee136dcb35", + "b456805d55828564b57111e74ee041eee24f4367", + "86a28b48ddb495f5906962730935026723633236", + "835d341e0864af676b9e068a7d328f61a5497061", + "35af5903c03e247d87281f765e7fb9ae886cad34", + "a34b470a40cc7c7cd9ec6a6856c64c4171faacea", + "852a3078db17db902074e01f1c793163628ad6b1", + "3832f3a5ac5b399b9bdf9009ae10c4d509535771", + "ac8438bf9ec094599fb5ade592e214bb00f10491", + "9ec3a2b382630f71e72aaa03f31a88dd0be90a6c", + "95b212c995c7c35b0025a0879e9339528c5cf58b", + "6eea6ff11934d7ba92debfb1e2b79d5523fe31a7", + "06b3deb6022d8ad1efcc61ba4939effd5de8e69c", + "17ec45b50c68059aaaccee346f0bfda5a4bec2dc", + "ade6d78553a281c17ce10851241a178bf4c949aa", + "69808c61a27c8e46fa29c8832f56c135cafe60db", + "4a412a9b74eb6d96f0eba4746ee24a1600a86f12", + "9c9dcd3a11c268ffb93244aaad9e0c0bf2751b7a", + "2775d015b1b1be2929241460fb15c82980408547", + "1efc5de40a9e9597db1a1a0b2041bedf6596e3b9", + "573d09ed3b524af1d3bfe9d38943a0aee52a1143", + "fa6eb94e6f8ac039af58c1e811769ccb161d113e", + "332ec7fad41610531472240682be32b16ba3554d", + "173c415171a1f2a035a9ffb029b40e4524c970b5", + "6f6b2f6eec7b23f22908ba511d38f2818ec33c4a", + "dc2af2d67288eee1f5f1bd0cc1a2b593ea93a9d7" + ] + }, + "fc27d95861d56fe16a2b66150e31652b76e8c678": { + "state": "not_found", + "missingChunks": [ + "4319cc997e630ebf455e1129a9075098b76a0bc3", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "6b7d4a2f7e10c61f5de3c707c91712ada4e8d709", + "e5ee80fe7567510a0b9700c1735273dd998a9275", + "3a41065abe29054ae0492b514f1b9bcdd87bc0f0", + "7f65b043bde74c24a38a2e34e2ca6463c690dd27", + "05abceace007bea1ef0fd726e40a9097d5f77978", + "8900820543a28e88fe7351da8b831784718f01da", + "159d743db757614b1a2865102b9d62812527a9eb", + "457c425aac7f4124df170b34ebfb15232bb73ee6", + "9f52217fc1c8e27ee0966f0387d4b67a68754cba", + "2b511a52f9b9ca348bcab575234d1beeb9b935e8", + "8234a73c183cda66f48a2ff18f60955a1f16c13b", + "ac91dbd6a33c1eaeb4f826ccd312537e029359c0", + "d999ae61b8abb775e7eb4b2a69988fb3bcf3872f", + "1c919d9d775fa8604738d3d341f686d844a0fd88", + "167982b3e3e67bbb98bd400291e1d99d0973f061", + "8539818fbedda47dfa0bf43425c5d3a420f20aa1", + "1212fe2b517e742db8eaa6de07bc5a77f56f20b0", + "4b99aac8be8f38b81e99a50f1d8293278688b612", + "1d99974601d006e21e4073b2537752d1f508986e", + "7ccd522aa2132f219ddaf0c0f24198809716e25a", + "fc09bbe937a0de5256f878cf711282d23dae275d", + "ae8b7f5ae04ff97a048ae60650739726e713770b", + "feb163bd50e5ce40ba2a756540ffa2e76de7117a", + "aaec469b811800ecf17f608c4d5eea1203581703", + "6b29011603e06f0d504fd7ac93debdff53ceae57", + "0afc54b1622a063f33b38637685e22d06f108c47", + "73126a55f008db3cc46d5a7c55f35000cfaeafc9", + "e56cdaa009ff7fd34e297f9465a9625035c92c81", + "dedff9cb5c9f4c4ff95eac6c94df27aa6dcdbcf7", + "c4387e27a164bcd5281016876e3f87ea58703f2c", + "bcf86646ceebd551b488c962945b52066355fc8c", + "83e167726814d1f774d6d85b501faba5f081210f", + "395d31a1145279393fac332e2b07ebb1eb19e2ee", + "e63933ca911f08c34c246d8382ed314c05146ee1", + "da72b7ca5d3535c35d31a28371d9d2de96fc41c4", + "64296473f56b1e96af0b3668673c3cbacb56d13b", + "fecbb5e8cac9116ac6baf59cb1ba5d32e05e75e8", + "e0e11757d931fea72ee1e3d45198743fe3e86eb8", + "000dfc6c4506a7093671258801c556dd114e638f", + "2cfbd99e41ecfa3199634b00a300fd6ed879f628", + "8587e3601b3c3aec54650d56510c35c494aa6da9", + "a05ef41ed5233c8a1bb512449f93947e5d19b315", + "d99910537f2419100d13572c27458dbad258d51c", + "17473e084b4c47e61e36f6538e218c3b1a192b35", + "049c243f8750cfdd20a317969fd610d674a64d66", + "544e64565b03133ab840c20bb459f7b2370da3b4", + "b9c9a52f82f7fffdd2da245cad79c960def3bf1d", + "ed59ffb607c4c80a75eb5b459b54bc9c3aabfde9", + "08babae5a3e7c00e8b25e68408d5609a2b69fc75", + "d6503a3655c3ba0e2204c282206f1dd17081fff8", + "cc170ee0772b46381a88deaf76e965fcda6267d6", + "67689ddc76dfd8c1b23a30cf8a61a8630fd72e55", + "ec70a87f0c8a3af1defda81e627839e5100573ff", + "fd7a5c1203090f99ae7c9c1b9a193a7a946913e8", + "5b13d7819f31ed20a23b9ff21fbae309efedbcb1", + "892e9833c9ba58f3c9d158157aec8e11d806af2b", + "25d4b3c9f72d2609a4f7185fe26b5351253b127e", + "5719f4afc14befc5a90eac5871b5d233e0fcf8eb", + "3dae541e8187780e5dcdd81471ec618fddebbe17", + "8c29b18999c66c6b6d544a7c77ae654953249f01", + "5b6f4cb501d27ad9dae91a73ca36826b07cf29a8", + "614e6eeb136ec9a8081ea279c0db6f743cad8641", + "a370b62fdc680cdf8de6c96dc8ecc55f76b675e9", + "0a16ca3b3867d713a0e2b2ac7d834d37fb0c3949", + "fe8d71c9e762aadf1c01880c52e76e728a905487", + "91e0e8e6fae43e819fbcfa90e49ac08cf9fb9700", + "5a4b7ba6b5feeafc900c435394e57f2d4d741517", + "515b75c71e0ba26593e9a4fc7d6c4d097a631770", + "dae5bdb12b598565bedd6afe49d3f3646dce52a3", + "3d6ee7d565c737c469887d4bc69c54f6636321ad", + "bd9b0356a7a18be2b454b37dbbc5b1c7ca0cddfb", + "184b4a07959be1ff248f5ce471d9cd6240f49eb1", + "689a82b31298dd31d9fe2015372cf31cdb28c5eb", + "2679cf26795e256a9ab76cf7d6afbc62ade773d1", + "a6e2c32f9c5b5d84e5236f3d2978a2a720232f93", + "a10f1ca42e8e169772533ab049bc832e9281ef0e", + "b3ba56d2d4769d8dac48330ad2e69c574103942d", + "b7242e0c387203a44ff93c54fa035b25df2a9557", + "b842b56f5a5ab3765b9c1898f3993ca987ce9657", + "df43f00aa8e5be57d18519a8a085cc69f91f5359", + "83fe929b18c5b3179ffae434b744145cc1ea531d", + "d996c853ee78aadf83b71293276fa92c2f62bfaf", + "e0775955aa87035ae57d50634c6cdc9d0cacdc11", + "4a20e252c095465a778ac8a00196822158990f13", + "a9dd90475d5244ecc7a6ea5bb1069e096b90287f", + "20d3ed546c94534ff047459b5ff7d6dffcc8008d", + "c02e14b32acb54556d96e835b77854a1d58ef97e", + "26afef1568ce8ae476b779dad139d2e6f9ee7fcd", + "c933565f0756b134ba4aad26bccb667dc819654f", + "1aef719724f387fbd4dad953cf21750867212c08", + "9cc5b2169dfb120dd762d232aace6bbc1d71056b", + "2c64b311c6c6036d80bae3868294ac192241cbce", + "c7b7f5d553fd45b612103372d634e5bea17ac00a", + "aa821226d4e8e56c1b9b7ed1000da1f19f4a634f", + "7d37adad4011dd3a2c3bb5a5e09dee5cfc04ffbd", + "966c39b16461a0d3c12bf5926fe3a42915dddf13", + "7cc993f4150918fad8b43857cfafb485278aece2", + "70b5b282d33298e51231b47dc96bdbef62b9600b", + "f83659cc83a248b9e6f8e28fce53611531a58f7d", + "029c5d3a49ead760988f9db94574d67e73f0f473", + "3a191086482f5375d2ecd28d28a810a13356c7c8", + "9774d6ef700d06a8f763e5ff47b603feb3c005a8", + "c14b489fffdbfb10c1a73815cc7020a2953801f6", + "e39ce6256846f4ab09ed355142a4dbd3060789ee", + "557c84cc1a0c008832409d92a3a43b159d036c72", + "c15f373b1c8ceb4d3ba157ffe35a42252f9d03c0", + "36725351b9d60c5e4e74c120fc143ddb3c25939d", + "352554178682d999d9ccf3920e6a11e2b1f6fd08", + "65d81f6983c4f61008865822490662843398c648", + "3dc378912174970221c08c113c685e1eb558c9e9", + "81d4d35a6a5fd77415e0d978ed1d7cb9418bfee8", + "290da5fe4da6ffa9d0090b0751d59e3c2f0c8d70", + "e62fa34b4e7f056b38aedac4d5bb52f9b5e2bbe2", + "97a4a7faf15542dd6560b17cbfc3f24362dfaabf", + "593458e2cd88b25a750bc23a38cd9e6d5edb02ac", + "88b785a500391008228f9ba39dd16695d8e2f57e", + "12d4e7886e5513236cb51ef64d127b9427e0a153", + "e2280ecc4c138a55919aa8743ae4bb9f11dda53e", + "2806034be3b911114fa865061f5555c1e85dbdef", + "08774c0c0f7c9abd870bb5db931051d4d87af8cf", + "21e49a8571179fb2b62aa3707e355bef56ad62bf", + "f0987b3b00a8c2979f18596c658ea573ce20efcf", + "4cd9d777fda5442d666ddb41657f61872e9f5dcb", + "a3fea5124b9b731a9eb96fae485674c47869ec24", + "1bc0e4b16c3d8ada98b3850a6b00fd7362fb9bf3", + "a2c1e2fa707a563eb4bdbd0bce56cd5c321d8036", + "e4baa5fadd450de5dc787aa5e1bb1c6e8c522ae6", + "06bd0baa08a88f97ecf6dac91693293341d4e222", + "43458d67502cb887158950ac5e1a5b0cae1b0467", + "c08ade277409e2d8c32de2a71db059b2913cf45b", + "ffb0d4c10dc1cd10ed6f6fd732530a64b848a604", + "65d8818d3ccfbb504ce4ed6b5053965ab090b811", + "389efeb79ede242031bf6b05bbfac47d85bce974", + "f3d4c7238ee0dd1ffe6b625217e35b12434ad2bc", + "37a9bbfe0875d567af6c966fc2cc4e8e03d35601", + "fa0c32cd98db58a794133c268f216223a4420ea7", + "d77e8bc2290db760b2c0e713493e14175580b567", + "a779623fc005d8c08e3ad9e5c944090bf05cc724", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "9cc6aecea21497009f876b268bcfb4bed415dad2", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "605db3fdbaff4ba13729371ad0c4fbab3889378e", + "b83ff1eacedae43641d4d8257637fd1008e6eef7", + "630bea217c92e8e02c3a7af7a35aa59c024a6fe9", + "b937827693b57c0f37445c1f58d4f941255c0bc4", + "af1036d9612c0ac7ba0c146a6bd9ac769771bbc8", + "9c5ea34f8d364662ab96f57a58044fe1a9642f44", + "bd4cf063f3b470fd35a7cac722d228d92260b761", + "358d5763fb2019e7377bb059a9bb3ea72db910fa", + "b77f6cc6951b6fa515cd12e516f45505a5d58396", + "ba0c851ddf3a22fd15f2b7343b736a1e66be7b27", + "f48449c71baaa602a5153698130d38f29ca4ccdc", + "75a3ac93b626b7546e02988b55781fbc2548ae01", + "4e9b1733507a9d7272499cd24736c97b6eee0685", + "ea7f5692f55ef37acc7b2ae22c29b96c091a445a", + "52e2fade9aaa2407f74f3e169fd92107b23d889a", + "8d5c741584655671307d5263bf84912ac7df6e5b", + "a8098f9b94ded65ea88dfbc8fb035678b7261dd0", + "2f8cd68838e5f4208062a8e89ef95a3f97e21924", + "8e21674c1f7ad162e29ef41271b5816da4123a15", + "b725c6c18dea2c19966d7e0a505161857c57003f", + "ad1ca3a874786dbeba87f5f142104200de70682a", + "a6e69a0dab96a802fd3e97a725346966a150e02a", + "b6378cd4bf6b23507482e535de6d609d19ca3c11", + "f17a710d32c1aafa7954971497a2eff119f50e55", + "40ba38ee9cbc0e1d2cc752cd6ee963bb9ed8dae6", + "84fcdce8dd781653d192e077ae239c289466c770", + "8a91ab166ed95b79ed6ff6b12072b0c9db0346ef", + "41e7f0da22158c4b68b1e56af2ad8d52db94cf2c", + "b00341eaa95bcfabec52cc590a09dbd2068ab812", + "8edffe6a79caed9e07826e9d3fae11d9c177fcf6", + "2a30c0f2c6f51720a625eac24af75610f4a3d4b2", + "6fa47e7fb1ce6fbc577534740a8eb798f9bdcffc", + "1930ec5f11040d8c009069e456654a9363468d39", + "4a8b0edb116ec7c2e1f3701fbd8fedf6a50ee83b", + "3585c92388aedf1491f58ad40f22cc858fc3e14f", + "db338bfa98de9a3f166f3f44950000c23abb2ee1", + "29708252b0a6f8c7a5e49ee9b2701575a483e33b", + "59e8e46590497ccacc94282daef071e69e786f52", + "c2bf7c5886f28619acc2fb4cc6c979bf3684a99d", + "e93d4aa301859451c0d8cf5c00f1d6203251f33e", + "04e234bd74e9f2d0b38b07b9bf836c49502c1d9e", + "8fedf56abae6f72bbb71cfe24b9ab731dedc046c", + "1f85dfc8efbcb70d5e5de0ae46d8f31d8085ef05", + "ade40e7010e4f9ce419bbddcc2dcc5d5f6a9eaf6", + "7e5d7dcd536e9795c62a8babff6b08e91c2dd812", + "44bc798faa06a6d03e3ebafd1d572820be0e417e", + "e579a754883dea84ea547936862ff5ef8310670d", + "5a16069977c453be5fd8d27108707215afd52d49", + "531baab9c1404503f1a4855544dd25e97817a32d", + "6f0709626702eae2bd072b446e4b9f250a6a830d", + "b02acc5cf7e43e2175e6964e2725c17cf16edf27", + "35ff4c54da01a39779d8a47461700ef8ed4783f5", + "781f114ad334bcb5ea2463a9ba81398a6fcf4e38", + "5bc009d87ddc4aba4658f6765e6bc96a54b51cbb", + "051e36276c48e05b156405753c6395b1ee625db4" + ] + } +} diff --git a/tests/integration/_responses/debug_files/get-chunk-upload-small-chunks.json b/tests/integration/_responses/debug_files/get-chunk-upload-small-chunks.json new file mode 100644 index 0000000000..09f7da5460 --- /dev/null +++ b/tests/integration/_responses/debug_files/get-chunk-upload-small-chunks.json @@ -0,0 +1,11 @@ +{ + "url": "organizations/wat-org/chunk-upload/", + "chunkSize": 2048, + "chunksPerRequest": 64, + "maxFileSize": 2147483648, + "maxRequestSize": 33554432, + "concurrency": 8, + "hashAlgorithm": "sha1", + "compression": ["gzip"], + "accept": ["debug_files", "release_files", "pdbs", "portablepdbs", "sources", "bcsymbolmaps"] +} diff --git a/tests/integration/debug_files/upload.rs b/tests/integration/debug_files/upload.rs index 8be7ee7711..ca6c00a9d7 100644 --- a/tests/integration/debug_files/upload.rs +++ b/tests/integration/debug_files/upload.rs @@ -1,5 +1,6 @@ +use std::collections::HashSet; use std::sync::atomic::{AtomicBool, Ordering}; -use std::sync::LazyLock; +use std::sync::{Arc, LazyLock, Mutex}; use std::{fs, str}; use regex::bytes::Regex; @@ -380,3 +381,127 @@ fn chunk_upload_multiple_files() { .with_default_token() .run_and_assert(AssertCommand::Success); } + +#[test] +/// This test verifies a correct chunk upload of multiple debug files +/// with a small chunk size (2048 bytes). +/// There are also multiple requests to the chunk upload endpoint, since +/// there are more chunk than the maximum allowed per request. +fn chunk_upload_multiple_files_small_chunks() { + /// The chunk upload options specify that a single request should contain + /// at most 64 chunks. + const CHUNKS_PER_REQUEST: usize = 64; + + /// 582 chunks will be uploaded in total. + const TOTAL_CHUNKS: usize = 582; + + /// We expect the smallest number of requests that can be used to upload + /// all chunks, given the maximum number of chunks per request. + const EXPECTED_REQUESTS: usize = TOTAL_CHUNKS.div_ceil(CHUNKS_PER_REQUEST); + + // Store all chunks received at the chunk upload endpoint. + let received_chunks = Arc::new(Mutex::new(HashSet::>::new())); + let received_chunks_closure = received_chunks.clone(); + + let expected_chunks = fs::read( + "tests/integration/_expected_requests/debug_files/upload/chunk_upload_small_chunks.bin", + ) + .expect("expected chunks file should be present"); + // This is the boundary used in the expected request file. + // It was randomly generated when the expected request was recorded. + let expected_chunks_boundary = "------------------------au0ff4bj3Ky3LCMhImSTsy"; + + let is_first_assemble_call = AtomicBool::new(true); + TestManager::new() + .mock_endpoint( + MockEndpointBuilder::new("GET", "/api/0/organizations/wat-org/chunk-upload/") + .with_response_file("debug_files/get-chunk-upload-small-chunks.json"), + ) + .mock_endpoint( + MockEndpointBuilder::new( + "POST", + "/api/0/projects/wat-org/wat-project/files/difs/assemble/", + ) + .with_header_matcher("content-type", "application/json") + .with_response_fn(move |_| { + if is_first_assemble_call.swap(false, Ordering::Relaxed) { + fs::read( + "tests/integration/_responses/debug_files/\ + assemble-chunk-upload-small-chunks.json", + ) + .expect("first assemble response file should be present") + } else { + r#"{ + "6e217f035ed538d4d6c14129baad5cb52e680e74": { + "state": "created", + "missingChunks": [] + }, + "500848b7815119669a292f2ae1f44af11d7aa2d3": { + "state": "created", + "missingChunks": [] + }, + "fc27d95861d56fe16a2b66150e31652b76e8c678": { + "state": "created", + "missingChunks": [] + } + }"# + .into() + } + }) + .expect(2), + ) + .mock_endpoint( + MockEndpointBuilder::new("POST", "/api/0/organizations/wat-org/chunk-upload/") + .with_response_fn(move |request| { + let boundary = chunk_upload::boundary_from_request(request) + .expect("content-type header should be a valid multipart/form-data header"); + + let body = request.body().expect("body should be readable"); + + let chunks = chunk_upload::split_chunk_body(body, boundary) + .expect("body should be a valid multipart/form-data body"); + + // No single request should contain more than CHUNKS_PER_REQUEST chunks. + assert!(chunks.len() <= CHUNKS_PER_REQUEST); + + received_chunks_closure + .lock() + .expect("should be able to lock mutex") + .extend(chunks.into_iter().map(|chunk| chunk.into())); + + vec![] + }) + .expect(EXPECTED_REQUESTS), + ) + .assert_cmd(vec![ + "debug-files", + "upload", + "tests/integration/_fixtures/debug_files/upload/chunk_upload_multiple_files", + ]) + .with_default_token() + .run_and_assert(AssertCommand::Success); + + // For simplicity, even though multiple requests are expected, the expected chunks + // are all stored in a single file, which was generated by setting a larger maximum + // number of chunks per request when generating the expected request. + let expected_chunks = + chunk_upload::split_chunk_body(&expected_chunks, expected_chunks_boundary) + .expect("expected chunks file should be a valid multipart/form-data body"); + + // Transform received chunks from a set of vectors to a set of slices. + let received_chunks_guard = received_chunks + .lock() + .expect("should be able to lock mutex"); + + let received_chunks: HashSet<_> = received_chunks_guard + .iter() + .map(|chunk| chunk.as_slice()) + .collect(); + + // Use assert! because in case of failure, the output with assert_eq! + // is too long to be useful. + assert!( + received_chunks == expected_chunks, + "Uploaded chunks differ from the expected chunks" + ); +}