[Tarantool-patches] [PATCH v6 2/3] test: add a test for wal_cleanup_delay option

Cyrill Gorcunov gorcunov at gmail.com
Tue Mar 30 00:46:25 MSK 2021


On Mon, Mar 29, 2021 at 11:07:29PM +0200, Vladislav Shpilevoy wrote:
> 
> 2. Do you know that boolean expressions don't need to be compared
> with the boolean constants explicitly? You could write
> 
> 	assert(box.info.gc().is_paused).
> 
> The same in all the other similar places in this file. Especially
> where you do '== false' which is super confusing.

Force pushed an update, is that what you've in mind?
---
 test/replication/gh-5806-xlog-cleanup.result   | 12 ++++++------
 test/replication/gh-5806-xlog-cleanup.test.lua | 12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/test/replication/gh-5806-xlog-cleanup.result b/test/replication/gh-5806-xlog-cleanup.result
index da09daf17..412e8f02d 100644
--- a/test/replication/gh-5806-xlog-cleanup.result
+++ b/test/replication/gh-5806-xlog-cleanup.result
@@ -298,7 +298,7 @@ box.snapshot()
  | ---
  | - ok
  | ...
-assert(box.info.gc().is_paused == true)
+assert(box.info.gc().is_paused)
  | ---
  | - true
  | ...
@@ -400,7 +400,7 @@ test_run:cmd('delete server replica')
 
 test_run:cmd('restart server master with args="3600"')
  | 
-assert(box.info.gc().is_paused == true)
+assert(box.info.gc().is_paused)
  | ---
  | - true
  | ...
@@ -480,14 +480,14 @@ master_uuid = test_run:eval('master', 'return box.info.uuid')[1]
 replica_uuid = test_run:eval('replica', 'return box.info.uuid')[1]
  | ---
  | ...
-master_custer = test_run:eval('master', 'return box.space._cluster:select()')[1]
+master_cluster = test_run:eval('master', 'return box.space._cluster:select()')[1]
  | ---
  | ...
-assert(master_custer[1][2] == master_uuid)
+assert(master_cluster[1][2] == master_uuid)
  | ---
  | - true
  | ...
-assert(master_custer[2][2] == replica_uuid)
+assert(master_cluster[2][2] == replica_uuid)
  | ---
  | - true
  | ...
@@ -511,7 +511,7 @@ test_run:switch('master')
  | ...
 test_run:cmd('restart server master with args="3600"')
  | 
-assert(box.info.gc().is_paused == true)
+assert(box.info.gc().is_paused)
  | ---
  | - true
  | ...
diff --git a/test/replication/gh-5806-xlog-cleanup.test.lua b/test/replication/gh-5806-xlog-cleanup.test.lua
index b65563e7f..5af98d362 100644
--- a/test/replication/gh-5806-xlog-cleanup.test.lua
+++ b/test/replication/gh-5806-xlog-cleanup.test.lua
@@ -137,7 +137,7 @@ box.snapshot()
 test_run:cmd('restart server master with args="3600"')
 box.space.test:insert({2})
 box.snapshot()
-assert(box.info.gc().is_paused == true)
+assert(box.info.gc().is_paused)
 
 test_run:cmd('start server replica')
 
@@ -176,7 +176,7 @@ test_run:cmd('cleanup server replica')
 test_run:cmd('delete server replica')
 
 test_run:cmd('restart server master with args="3600"')
-assert(box.info.gc().is_paused == true)
+assert(box.info.gc().is_paused)
 
 test_run:switch('master')
 box.cfg{wal_cleanup_delay = 0.01}
@@ -206,9 +206,9 @@ test_run:cmd('start server replica')
 test_run:switch('default')
 master_uuid = test_run:eval('master', 'return box.info.uuid')[1]
 replica_uuid = test_run:eval('replica', 'return box.info.uuid')[1]
-master_custer = test_run:eval('master', 'return box.space._cluster:select()')[1]
-assert(master_custer[1][2] == master_uuid)
-assert(master_custer[2][2] == replica_uuid)
+master_cluster = test_run:eval('master', 'return box.space._cluster:select()')[1]
+assert(master_cluster[1][2] == master_uuid)
+assert(master_cluster[2][2] == replica_uuid)
 
 test_run:cmd('stop server replica')
 test_run:cmd('cleanup server replica')
@@ -216,7 +216,7 @@ test_run:cmd('delete server replica')
 
 test_run:switch('master')
 test_run:cmd('restart server master with args="3600"')
-assert(box.info.gc().is_paused == true)
+assert(box.info.gc().is_paused)
 
 --
 -- Drop the replica from _cluster and make sure
-- 
2.30.2



More information about the Tarantool-patches mailing list