Skip to content

Commit

Permalink
Avoid the system key range in the eunit test random key generator.
Browse files Browse the repository at this point in the history
Previously the generator could sometimes return values in the system
range and tests would fail with the unexpected 2004 error.
  • Loading branch information
nickva committed Apr 23, 2020
1 parent 1de3e2e commit d4663cf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/erlfdb_03_transaction_options_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,6 @@ size_limit_on_db_handle_test() ->
end)).


gen(Size) ->
crypto:strong_rand_bytes(Size).
gen(Size) when is_integer(Size), Size > 1 ->
RandBin = crypto:strong_rand_bytes(Size - 1),
<<0, RandBin/binary>>.

0 comments on commit d4663cf

Please sign in to comment.