From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Alexander Turenko <alexander.turenko@tarantool.org>
Cc: Sergei Voronezhskii <sergw@tarantool.org>,
tarantool-patches@freelists.org
Subject: Re: [tarantool-patches] Re: [PATCH] test: fix unix socket conflict in socket.test.lua
Date: Mon, 29 Oct 2018 12:32:29 +0300 [thread overview]
Message-ID: <20181029093229.ljq7gcvssleckfvo@esperanza> (raw)
In-Reply-To: <20181029082528.ou2zooi33vcblk6b@tkn_work_nb>
On Mon, Oct 29, 2018 at 11:25:29AM +0300, Alexander Turenko wrote:
> On Thu, Oct 25, 2018 at 12:43:39PM +0300, Vladimir Davydov wrote:
> > On Thu, Oct 25, 2018 at 05:21:45AM +0300, Alexander Turenko wrote:
> > > It is needed to run the test in parallel on several test-run workers to
> > > investigate flaky failures of the test.
> >
> > I don't think I understand. Do you mean that this test doesn't fix the
> > test flakiness and is only needed for further investigation?
> >
>
> Yes (but now I have added some fixes that can eliminate some flaky
> failures). It is often convenient to run something like...
>
> ```
> TEST_RUN_TESTS=$(for i in $(seq 1 100); do echo -n "app/ "; done) make test
> ```
>
> ...to prove the suite is ready to run in parallel mode.
>
> > > diff --git a/test/app/socket.result b/test/app/socket.result
> > > index 2f002a37e..1a570b9fa 100644
> > > --- a/test/app/socket.result
> > > +++ b/test/app/socket.result
> > > @@ -42,6 +42,29 @@ test_run:cmd("push filter '(error: .builtin/.*[.]lua):[0-9]+' to '\\1'")
> > > ---
> > > - true
> > > ...
> > > +test_run:cmd("push filter '(/tmp/tarantool-test-socket)-[0-9]+' to '\\1'")
> > > +---
> > > +- true
> > > +...
> > > +-- /tmp/tarantool-test-socket-${TEST_RUN_WORKER_ID}
> > > +test_run:cmd("setopt delimiter ';'")
> > > +---
> > > +- true
> > > +...
> > > +function get_temp_socket_path()
> > > + local base_path = '/tmp/tarantool-test-socket'
> > > + local worker_id = os.getenv('TEST_RUN_WORKER_ID')
> > > + if not worker_id then
> > > + return base_path
> > > + end
> > > + return ('%s-%s'):format(base_path, worker_id)
> > > +end;
> >
> > Why don't you simply create the file in the worker directory?
>
> Sure, I can. Rewritten the test. But socket.skipcond still uses
> /tmp/tarantool-test-socket-${WORKER_ID}, because its working directory
> is `test`.
>
> The whole new patch is below.
>
> commit 224fcdf2a5e8f84971253f1d585b94213d06a384
> Author: Alexander Turenko <alexander.turenko@tarantool.org>
> Date: Thu Oct 25 04:06:46 2018 +0300
>
> test: fix unix socket conflict in socket.test.lua
>
> Increased socket.readable / socket.wait timeouts.
>
> Rewritten port choosing: repeat bind+listen until succeeds, exclude
> incorrect port 65536 from the range.
>
> All these changes are needed to run the test in parallel on several
> test-run workers to investigate flaky failures of the test / of the
> suite. Some of these changes can also eliminate possible flaky failures.
./test-run -j -1 app/socket.test.lua doesn't work with this patch:
} app/socket.test.lua
} Test.run() received the following error:
} Traceback (most recent call last):
} File "/home/vlad/src/tarantool/test-run/lib/test.py", line 174, in run
} execfile(self.skip_cond, dict(locals(), **server.__dict__))
} File "app/socket.skipcond", line 8, in <module>
} worker_id = os.environ['TEST_RUN_WORKER_ID']
} File "/usr/lib/python2.7/UserDict.py", line 40, in __getitem__
} raise KeyError(key)
} KeyError: 'TEST_RUN_WORKER_ID'
I think you shouldn't use TEST_RUN_WORKER_ID in skipcond after all.
Instead you should make a temporary file.
Also, I've seen the following failure once. Not sure if it's related:
} [001] app/socket.test.lua [ fail ]
} [001]
} [001] Test failed! Result content mismatch:
} [001] --- app/socket.result Mon Oct 29 12:06:39 2018
} [001] +++ socket.reject Mon Oct 29 12:13:34 2018
} [001] @@ -2810,7 +2810,7 @@
} [001] ...
} [001] echo_fiber ~= nil
} [001] ---
} [001] -- true
} [001] +- false
} [001] ...
} [001] client:write('hello')
} [001] ---
} [001]
} [001] Last 15 lines of Tarantool Log file [Instance "app"][/home/vlad/src/tarantool/test/var/001_app/app.log]:
} [001] 2018-10-29 12:13:34.188 [20123] main/144/server/unix/:tarantool-test-soc I> started
} [001] 2018-10-29 12:13:34.189 [20123] main/142/server/unix/:tarantool-test-soc utils.c:939 E> LuajitError: builtin/socket.lua:80: attempt to use closed socket
} [001] 2018-10-29 12:13:34.189 [20123] main/146/server/unix/:tarantool-test-soc I> started
} [001] 2018-10-29 12:13:34.190 [20123] main/144/server/unix/:tarantool-test-soc utils.c:939 E> LuajitError: builtin/socket.lua:80: attempt to use closed socket
} [001] 2018-10-29 12:13:34.190 [20123] main/148/server/unix/:tarantool-test-soc I> started
} [001] 2018-10-29 12:13:34.190 [20123] main/146/server/unix/:tarantool-test-soc utils.c:939 E> LuajitError: builtin/socket.lua:80: attempt to use closed socket
} [001] 2018-10-29 12:13:34.190 [20123] main/150/server/unix/:tarantool-test-soc I> started
} [001] 2018-10-29 12:13:34.191 [20123] main/148/server/unix/:tarantool-test-soc utils.c:939 E> LuajitError: builtin/socket.lua:80: attempt to use closed socket
} [001] 2018-10-29 12:13:34.191 [20123] main/152/server/unix/:tarantool-test-soc I> started
} [001] 2018-10-29 12:13:34.191 [20123] main/150/server/unix/:tarantool-test-soc utils.c:939 E> LuajitError: builtin/socket.lua:80: attempt to use closed socket
} [001] 2018-10-29 12:13:34.191 [20123] main/154/server/unix/:tarantool-test-soc I> started
} [001] 2018-10-29 12:13:34.192 [20123] main/152/server/unix/:tarantool-test-soc utils.c:939 E> LuajitError: builtin/socket.lua:80: attempt to use closed socket
} [001] 2018-10-29 12:13:34.192 [20123] main/154/server/unix/:tarantool-test-soc utils.c:939 E> LuajitError: builtin/socket.lua:80: attempt to use closed socket
} [001] 2018-10-29 12:13:34.364 [20123] main/161/echoserv/::1:0 I> started
} [001] 2018-10-29 12:13:34.417 [20123] main/161/echoserv/::1:0 utils.c:939 E> LuajitError: builtin/socket.lua:80: attempt to use closed socket
} [Main process] Got failed test; gently terminate all workers...
} [001] Worker "001_app" got failed test; stopping the server...
} ---------------------------------------------------------------------------------
} Statistics:
} * fail: 1
} Failed tasks:
} - [app/socket.test.lua, null]
} # logfile: /home/vlad/src/tarantool/test/var/log/001_app.log
} # reproduce file: /home/vlad/src/tarantool/test/var/reproduce/001_app.list.yaml
} ---
} - [app/socket.test.lua, null]
} ...
next prev parent reply other threads:[~2018-10-29 9:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-25 2:21 Alexander Turenko
2018-10-25 9:43 ` Vladimir Davydov
2018-10-29 8:25 ` [tarantool-patches] " Alexander Turenko
2018-10-29 9:32 ` Vladimir Davydov [this message]
2018-10-29 11:29 ` Alexander Turenko
2018-10-29 16:09 ` Vladimir Davydov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181029093229.ljq7gcvssleckfvo@esperanza \
--to=vdavydov.dev@gmail.com \
--cc=alexander.turenko@tarantool.org \
--cc=sergw@tarantool.org \
--cc=tarantool-patches@freelists.org \
--subject='Re: [tarantool-patches] Re: [PATCH] test: fix unix socket conflict in socket.test.lua' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox