[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Thu Feb 29 13:21:01 UTC 2024


The branch, master has been updated
       via  667265b6851 ctdb-tests: Limit red-black tree test to 5s of random inserts
      from  0c1ac197768 samba-tool user getpassword: Clarify success wording

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 667265b6851e3c99f761ed65e8d2b9a8eb9cb4e1
Author: Martin Schwenke <mschwenke at ddn.com>
Date:   Thu Feb 29 13:30:04 2024 +1100

    ctdb-tests: Limit red-black tree test to 5s of random inserts
    
    rb_test_001.sh runs for 60s even though rb_tree.c is almost never
    modified.  This generally extends test time by an unreasonable amount
    of time.
    
    Add an optional timeout (in seconds) argument to rb_test, defaulting
    to 60, and pass 5 from rb_test_001.sh.  If anyone ever significantly
    updates rb_tree.c then they can run rb_test directly with its default
    60s timeout... or for as long as they like.
    
    Reported-by: Volker Lendecke <vl at samba.org>
    Signed-off-by: Martin Schwenke <mschwenke at ddn.com>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Thu Feb 29 13:20:40 UTC 2024 on atb-devel-224

-----------------------------------------------------------------------

Summary of changes:
 ctdb/tests/UNIT/cunit/rb_test_001.sh |  6 ++++--
 ctdb/tests/src/rb_test.c             | 14 +++++++++++---
 2 files changed, 15 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/tests/UNIT/cunit/rb_test_001.sh b/ctdb/tests/UNIT/cunit/rb_test_001.sh
index 25d3ceb8ed0..a2cf2571f98 100755
--- a/ctdb/tests/UNIT/cunit/rb_test_001.sh
+++ b/ctdb/tests/UNIT/cunit/rb_test_001.sh
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+timeout=5
+
 . "${TEST_SCRIPTS_DIR}/unit.sh"
 
 output="\
@@ -22,10 +24,10 @@ traverse data:3
 
 deleting key1
 
-run random insert and delete for 60 seconds
+run random insert and delete for ${timeout} seconds
 
 deleting all entries"
 
 ok "$output"
 
-unit_test rb_test
+unit_test rb_test "$timeout"
diff --git a/ctdb/tests/src/rb_test.c b/ctdb/tests/src/rb_test.c
index d712c9a80ad..aaab459477f 100644
--- a/ctdb/tests/src/rb_test.c
+++ b/ctdb/tests/src/rb_test.c
@@ -105,6 +105,7 @@ static int count_traverse_abort(void *p, void *d)
 */
 int main(int argc, const char *argv[])
 {
+	unsigned int timeout = 0;
 	int traverse_count;
 	int i,j,k;
 	trbt_tree_t *tree;
@@ -118,6 +119,13 @@ int main(int argc, const char *argv[])
 	uint32_t **u32array;
 	uint32_t checksum;
 
+	if (argc >= 2) {
+		timeout = atoi(argv[1]);
+	}
+	if (timeout == 0) {
+		timeout = 60;
+	}
+
 	/* testing trbt_insert32_callback for num_records */
 	memctx   = talloc_new(NULL);
 	assert(memctx != NULL);
@@ -252,7 +260,7 @@ int main(int argc, const char *argv[])
 	talloc_free(memctx);
 
 
-	printf("\nrun random insert and delete for 60 seconds\n");
+	printf("\nrun random insert and delete for %u seconds\n", timeout);
 	memctx   = talloc_new(NULL);
 	assert(memctx != NULL);
 
@@ -262,12 +270,12 @@ int main(int argc, const char *argv[])
 	i=0;
 	start_timer();
 	checksum = 0;
-	/* Add and delete nodes from a 3 level tree for 60 seconds.
+	/* Add and delete nodes from a 3 level tree for <timeout> seconds.
 	   Each time a node is added or deleted, traverse the tree and
 	   compute a checksum over the data stored in the tree and compare this
 	   with a checksum we keep which contains what the checksum should be
 	 */
-	while(end_timer() < 60.0){
+	while(end_timer() < (double)timeout){
 		char *str;
 
 		i++;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list