gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: fix non deterministic test


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: fix non deterministic test
Date: Fri, 11 Oct 2019 19:13:25 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 1e023a539 fix non deterministic test
1e023a539 is described below

commit 1e023a539b4f0b9f68ae6948d3328eafb7ba49e2
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Fri Oct 11 19:11:06 2019 +0200

    fix non deterministic test
---
 src/peerstore/test_peerstore_api_data.conf |  3 ++-
 src/peerstore/test_peerstore_api_sync.c    | 29 +++++++++++++++--------------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/src/peerstore/test_peerstore_api_data.conf 
b/src/peerstore/test_peerstore_api_data.conf
index 3ebda50eb..614d0cf5b 100644
--- a/src/peerstore/test_peerstore_api_data.conf
+++ b/src/peerstore/test_peerstore_api_data.conf
@@ -5,8 +5,9 @@ GNUNET_TEST_HOME = $GNUNET_TMP/test-gnunet-peerstore
 START_ON_DEMAND = YES
 BINARY = gnunet-service-peerstore
 UNIXPATH = $GNUNET_TMP/gnunet-service-peerstore.sock
-HOME = $SERVICEHOME
 DATABASE = sqlite
+UNIX_MATCH_UID = NO
+UNIX_MATCH_GID = YES
 #PREFIX = xterm -e gdb --args 
 
 [peerstore-sqlite]
diff --git a/src/peerstore/test_peerstore_api_sync.c 
b/src/peerstore/test_peerstore_api_sync.c
index b2ac860b7..503cb2f1e 100644
--- a/src/peerstore/test_peerstore_api_sync.c
+++ b/src/peerstore/test_peerstore_api_sync.c
@@ -109,7 +109,6 @@ iterate_cb (void *cls,
 static void
 test_cont (void *cls)
 {
-  h = GNUNET_PEERSTORE_connect (cfg);
   GNUNET_PEERSTORE_iterate (h,
                             subsystem,
                             &pid, key,
@@ -117,6 +116,19 @@ test_cont (void *cls)
                             NULL);
 }
 
+static void
+store_cont (void *cls, int success)
+{
+  ok = success;
+  /* We need to wait a little bit to give the disconnect
+     a chance to actually finish the operation; otherwise,
+     the test may fail non-deterministically if the new
+     connection is faster than the cleanup routine of the
+     old one. */
+  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+                                &test_cont,
+                                NULL);
+}
 
 /**
  * Actually run the test.
@@ -132,18 +144,7 @@ test1 ()
                           val, strlen (val) + 1,
                           GNUNET_TIME_UNIT_FOREVER_ABS,
                           GNUNET_PEERSTORE_STOREOPTION_REPLACE,
-                          NULL, NULL);
-  GNUNET_PEERSTORE_disconnect (h,
-                               GNUNET_YES);
-  h = NULL;
-  /* We need to wait a little bit to give the disconnect
-     a chance to actually finish the operation; otherwise,
-     the test may fail non-deterministically if the new
-     connection is faster than the cleanup routine of the
-     old one. */
-  GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
-                                &test_cont,
-                                NULL);
+                          &store_cont, NULL);
 }
 
 
@@ -171,7 +172,7 @@ main (int argc, char *argv[])
   if (0 !=
       GNUNET_TESTING_service_run ("test-gnunet-peerstore-sync",
                                   "peerstore",
-                                  "test_peerstore_api_data.conf",
+                                  "peerstore.conf",
                                   &run, NULL))
     return 1;
   if (0 != ok)

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]