You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2021/03/02 17:11:28 UTC

[GitHub] [couchdb] iilyak commented on a change in pull request #3395: Re-add transaction size exceeded test

iilyak commented on a change in pull request #3395:
URL: https://github.com/apache/couchdb/pull/3395#discussion_r585751093



##########
File path: test/elixir/test/bulk_docs_test.exs
##########
@@ -152,4 +163,11 @@ defmodule BulkDocsTest do
     assert resp.body["error"] == "bad_request"
     assert resp.body["reason"] == reason
   end
+
+  defp random_string(length) do
+    raw = :crypto.strong_rand_bytes(length)

Review comment:
       I didn't like this initially. However, unfortunately this is the easiest way to generate random bytes in Elixir. The alternative is probably slower:
    
   ```
   Enum.map(0..length, fn _ -> :rand.uniform(255) end) 
     |> List.to_string 
     |> Base.url_encode64
     |> binary_part(0, length)
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org