gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] branch master updated (129a6fc -> 8fcf76d)


From: gnunet
Subject: [gnunet-scheme] branch master updated (129a6fc -> 8fcf76d)
Date: Wed, 29 Jun 2022 18:33:09 +0200

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

maxime-devos pushed a change to branch master
in repository gnunet-scheme.

    from 129a6fc  bogus-interposition: Correct typo (thow -> throw).
     new 8c77340  service-communication: Document 'garbage-collectable'.
     new 8fcf76d  service-communication: Document 
'close-not-connected-no-fallbacks'.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/service-communication.tm | 56 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/doc/service-communication.tm b/doc/service-communication.tm
index 89c187d..191aa84 100644
--- a/doc/service-communication.tm
+++ b/doc/service-communication.tm
@@ -368,6 +368,62 @@
 
   Error messages are translated for the current locale.<todo|TODO actually
   call bindtextdomain>
+
+  <section|Testing service code>
+
+  The module <scm|(tests utils)> has \ a few procedures for testing service
+  code:
+
+  <\explain>
+    <scm|(garbage-collectable <var|service> <var|connect>)>
+  <|explain>
+    Test that the server object is properly garbage collectable \U i.e., make
+    sure that when the server object is not used anymore, all new fibers are
+    stopped after a GC. Due to Guile's conservative GC, this has some false
+    negatives (i.e., it passes when it shouldn't) and in theory false
+    positives (i.e., it fails when it shouldn't), although the test is
+    written in such a way that false positives should be rare.
+
+    Here, <var|service> is a string like <scm|"dht"> or <scm|"gns">. It is
+    required for generating the configuration file. <var|connect> is a
+    procedure that can be called as <scm|(connect config #:spawn _
+    #:connected _ #:disconnected _>), such as the <scm|connect> procedure
+    from (<todo|reference to DHT or NSE>.
+
+    This procedure returns a boolean value suitable for <scm|test-assert>.
+  </explain>
+
+  <\explain>
+    <scm|(close-not-connected-no-fallbacks <var|service> <var|connect>
+    <var|disconnect!> #:rest)>
+  <|explain>
+    This tests the automatic reconnection logic. It verifies that if the
+    service daemon is down, the connection and disconnection callbacks are
+    not called. The optional argument <var|rest> is a list of extra arguments
+    to pass to <var|connect>.
+
+    When run sufficiently slowly, false negatives are possible.
+  </explain>
+
+  <todo|document more>
+
+  <\example>
+    In <verbatim|tests/distributed-hash-table.scm>, we have the following
+    tests:
+
+    <\scm-code>
+      (import (srfi srfi-64) (test utils) (gnu gnunet dht client)
+
+      (test-assert "(DHT) close, not connected --\<gtr\> all fibers stop, no
+      callbacks called"
+
+      \ \ (close-not-connected-no-fallbacks "dht" connect disconnect!))
+
+      (test-assert "(DHT) garbage collectable"
+
+      \ \ (garbage-collectable "dht" connect))
+    </scm-code>
+  </example>
 </body>
 
 <\initial>

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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