make tests
Hakan Mattsson
hakan@REDACTED
Wed Sep 29 23:16:32 CEST 1999
On 29 Sep 1999, Luke Gorrie wrote:
luke>Actually, I was hacking Mnesia's transaction manager today and was
Great! What are you doing?
luke> about to ask on Wikie if we could have a play with the test
luke> suite. :-) I think it would be great if it was released as open
luke> source, but understand if it's a bit tangled up in larger things.
If your hacking is more serious than playing ;-), you will
definitely need the test suite.
The test suite of Mnesia is completely standalone, since it contains an
own customized lightweight test server, developed for the purpose of
testing and debugging Mnesia. The big test server of Erlang/OTP
actually originated from this test server, once upon the time. I
cannot see any problems with releasing the test suite of Mnesia (and
possibly Mnemosyne and Mnesia Session) as open source, but this is
up to the product manager of Erlang/OTP to decide.
luke> P.S., someone mentioned that the wait before restart on aborted
luke> transactions had been reduced in the closed-source Mnesia. Could
luke> someone tell me the new value?
In Mnesia 3.8, the implementation is as follows:
random_time(Retries) ->
UpperLimit = 500,
Dup = Retries * Retries,
MaxIntv = trunc(UpperLimit * (1-(50/((Dup)+50)))),
case get(random_seed) of
undefined ->
{X, Y, Z} = erlang:now(), %% time()
random:seed(X, Y, Z),
Dup + random:uniform(MaxIntv);
_ ->
Dup + random:uniform(MaxIntv),
end.
/Håkan
More information about the erlang-questions
mailing list