Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2] core: handle fiber cancellation for fiber.cond
Date: Tue, 1 Dec 2020 00:46:33 +0300	[thread overview]
Message-ID: <20201130214633.a4okm6brex6ilzpb@tkn_work_nb> (raw)
In-Reply-To: <12e5f150-8e08-1004-ad8a-c6bd1a04fd5f@tarantool.org>

> > diff --git a/test/app-tap/gh-5013-fiber-cancel.test.lua b/test/app-tap/gh-5013-fiber-cancel.test.lua
> > new file mode 100755
> > index 000000000..ca4ca2c90
> > --- /dev/null
> > +++ b/test/app-tap/gh-5013-fiber-cancel.test.lua
> > @@ -0,0 +1,23 @@
> > +#!/usr/bin/env tarantool
> > +
> > +local tap = require('tap')
> > +local fiber = require('fiber')
> > +local test = tap.test("gh-5013-fiber-cancel")
> > +
> > +test:plan(2)
> > +
> > +local result = {}
> > +
> > +function test_f()
> > +    local cond = fiber.cond()
> > +    local res, err = pcall(cond.wait, cond)
> > +    result.res = res
> > +    result.err = err
> > +end
> > +
> > +local f = fiber.create(test_f)
> > +f:cancel()
> > +fiber.yield()
> > +
> > +test:ok(result.res == false, 'expected result is false')
> > +test:ok(tostring(result.err) == 'fiber is cancelled', 'fiber cancellation should be reported')
> 
> 2. I think you are also supposed to call os.exit with test:check()
> like other tap tests do. Otherwise it probably always ends with 0
> code, and won't work properly when we will make tap tests non-diff
> based.

Just side note. TAP13 tests are already not diff-based. test-run parses
and verifies TAP13 output if a result file is not present. test-run also
checks the exit code of a process. (That's all are about 'core = app'
test suites.)

But I anyway think that it is good property to return non-zero exit code
from a test if it is not passed. When all tests are written this way, we
have more freedom around ways to run a test. Who knows, maybe we'll want
to run some tests in a very restricted environment, where it will be
hard to get all this python stuff workable?

  parent reply	other threads:[~2020-11-30 21:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-31 16:29 sergos
2020-11-01 10:13 ` Oleg Babin
2020-11-03 10:20   ` Sergey Ostanevich
2020-11-03 10:27     ` Oleg Babin
2020-11-04 10:00     ` Leonid Vasiliev
2020-11-16 22:12     ` Vladislav Shpilevoy
2020-11-18 22:05       ` Sergey Ostanevich
2020-11-22 16:01         ` Vladislav Shpilevoy
2020-11-23 21:47           ` Sergey Ostanevich
2020-11-24  7:31           ` Sergey Ostanevich
2020-11-04 10:00 ` Leonid Vasiliev
2020-11-05 20:42   ` Sergey Ostanevich
2020-11-10 21:16   ` Sergey Ostanevich
2020-11-12 20:15     ` Sergey Ostanevich
2020-11-13  8:26       ` Leonid Vasiliev
2020-11-30 22:49         ` Alexander Turenko
2020-11-16 22:12 ` Vladislav Shpilevoy
2020-11-25 21:32 ` Vladislav Shpilevoy
2020-11-29 21:41   ` Sergey Ostanevich
2020-11-30 21:46   ` Alexander Turenko [this message]
2020-11-30 21:01 ` Vladislav Shpilevoy
2020-12-02 10:58 ` Alexander V. Tikhonov
2020-12-02 22:18 ` Vladislav Shpilevoy

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=20201130214633.a4okm6brex6ilzpb@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2] core: handle fiber cancellation for fiber.cond' \
    /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