<HTML><BODY><br><br><br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
        Пятница,  6 апреля 2018, 11:49 +03:00 от Konstantin Osipov <kostja@tarantool.org>:<br><br><div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_15230045960000000958_BODY">* Konstantin Belyavskiy <<a href="mailto:k.belyavskiy@tarantool.org">k.belyavskiy@tarantool.org</a>> [18/04/06 11:40]:<br>
                                 > +socket = require('socket')<br>
> +---<br>
> +...<br>
> +s = socket.tcp_server('localhost', 3371, function() end)<br><br>
Is it possible to avoid using a specific port? The port may be<br>
already in use for a thousand of reasons, and this will break the test.</div></div></div></div></blockquote>Done, the aim here was to make one port busy to make sure, that no other tarantool instance use it.<br>But here was an error due to this port was socket based.<br> Update this code and transfer found port to replica script as a third parameter.<br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_15230045960000000958_BODY">
> +++ b/test/replication/replica_params.lua<br>
> @@ -0,0 +1,21 @@<br>
> +#!/usr/bin/env tarantool<br>
> +<br>
> +local quorum = tonumber(arg[1])<br>
> +local n_replics = tonumber(arg[2])<br>
> +listen = os.getenv("LISTEN")<br>
> +-- Test different replicaset configurations:<br>
> +-- First, when the only address in the replicaset is itself.<br>
> +repl = {listen}<br>
> +-- To test situation with second master unavailable, add<br>
> +-- second address (should be empty).<br>
> +if n_replics == 2 then repl = { listen, '127.0.0.1:3371' } end<br>
> +<br>
> +box.cfg({<br>
> +    listen              = listen,<br>
> +    replication         = repl,<br>
> +    memtx_memory        = 107374182,<br><br>
Why? What's magical about this number? Could you use 100 * 1024 *<br>
1024 instead? Then it's clear the test is not using too much<br>
memory and the exact amount is also clearly visible.</div></div></div></div></blockquote>OK, it was "copy exactly" principle, just reuse same value.<br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;"><div id=""><div class="js-helper js-readmsg-msg"><div><div id="style_15230045960000000958_BODY">
> +    replication_connect_quorum = quorum,<br>
> +    replication_connect_timeout = 0.1,<br>
> +})<br>
> +<br>
> +require('console').listen(os.getenv('ADMIN'))<br><br>
Thanks,<br><br><br>
-- <br>
Konstantin Osipov, Moscow, Russia, <span class="js-phone-number">+7 903 626 22 32</span><br><a href="http://tarantool.io" target="_blank">http://tarantool.io</a> - <a href="http://www.twitter.com/kostja_osipov" target="_blank">www.twitter.com/kostja_osipov</a><br><br></div></div></div></div></blockquote>
<br>
<br>Best regards,<br>Konstantin Belyavskiy<br>k.belyavskiy@tarantool.org<br></BODY></HTML>