[Tarantool-patches] [PATCH v4 13/16] box: allow calling promote on a candidate

Serge Petrenko sergepetrenko at tarantool.org
Thu Jul 15 17:06:08 MSK 2021



14.07.2021 21:25, Serge Petrenko пишет:
> Part of #6034
> ---
>   src/box/box.cc                                | 15 +---
>   .../gh-6034-election-candidate-promote.result | 84 +++++++++++++++++++
>   ...h-6034-election-candidate-promote.test.lua | 42 ++++++++++
>   test/replication/suite.cfg                    |  1 +
>   4 files changed, 128 insertions(+), 14 deletions(-)
>   create mode 100644 test/replication/gh-6034-election-candidate-promote.result
>   create mode 100644 test/replication/gh-6034-election-candidate-promote.test.lua
>

Fixed an obvious typo:

=========================

diff --git a/test/replication/gh-6034-election-candidate-promote.result 
b/test/replication/gh-6034-election-candidate-promote.result
index 76a54d5a6..2b4bc0213 100644
--- a/test/replication/gh-6034-election-candidate-promote.result
+++ b/test/replication/gh-6034-election-candidate-promote.result
@@ -60,7 +60,7 @@ next_nr = leader_nr % 3 + 1
   | ...
  -- Someone else may become a leader, thus promote may fail. But we're 
testing
  -- that it takes effect at all, so that's fine.
-_ = pcall(test_run:eval('election_replica'..next_nr, 'box.ctl.promote()'))
+_ = pcall(test_run.eval, test_run, 'election_replica'..next_nr, 
'box.ctl.promote()')
   | ---
   | ...
  new_term = test_run:eval('election_replica'..next_nr,\
diff --git 
a/test/replication/gh-6034-election-candidate-promote.test.lua 
b/test/replication/gh-6034-election-candidate-promote.test.lua
index 24c57f4cb..c25f9296d 100644
--- a/test/replication/gh-6034-election-candidate-promote.test.lua
+++ b/test/replication/gh-6034-election-candidate-promote.test.lua
@@ -32,7 +32,7 @@ term = test_run:eval('election_replica'..leader_nr,\
  next_nr = leader_nr % 3 + 1
  -- Someone else may become a leader, thus promote may fail. But we're 
testing
  -- that it takes effect at all, so that's fine.
-_ = pcall(test_run:eval('election_replica'..next_nr, 'box.ctl.promote()'))
+_ = pcall(test_run.eval, test_run, 'election_replica'..next_nr, 
'box.ctl.promote()')
  new_term = test_run:eval('election_replica'..next_nr,\
                           'return box.info.election.term')[1]
  assert(new_term > term)

=========================

-- 
Serge Petrenko



More information about the Tarantool-patches mailing list