[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 03/03: tests: Test cancelling a DHT search within a sear
From: |
gnunet |
Subject: |
[gnunet-scheme] 03/03: tests: Test cancelling a DHT search within a search callback. |
Date: |
Mon, 14 Feb 2022 22:22:39 +0100 |
This is an automated email from the git hooks/post-receive script.
maxime-devos pushed a commit to branch master
in repository gnunet-scheme.
commit ce8e5f2718bc76b58b91a500d2fade39628c63e9
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Mon Feb 14 21:21:35 2022 +0000
tests: Test cancelling a DHT search within a search callback.
* tests/distributed-hash-table.scm
("cancelling a search within a search callback does not hang"): New test.
---
tests/distributed-hash-table.scm | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/tests/distributed-hash-table.scm b/tests/distributed-hash-table.scm
index 9e2453b..84787bc 100644
--- a/tests/distributed-hash-table.scm
+++ b/tests/distributed-hash-table.scm
@@ -757,4 +757,25 @@ supported."
(wait done)
#true)))
+;; TODO: would be nice to verify that the necessary messages are sent to the
+;; DHT service.
+(test-assert "cancelling a search within a search callback does not hang"
+ (call-with-services/fibers
+ `(("dht" . ,(simulate-dht-service)))
+ (lambda (config spawn-fiber)
+ (define server (connect config))
+ (define datum (make-a-datum))
+ (define query (make-query (datum-type datum) (datum-key datum)))
+ (define search-defined (make-condition))
+ (define done (make-condition))
+ (define search
+ (start-get! server query (lambda (a-result)
+ (wait search-defined)
+ (stop-get! search)
+ (signal-condition! done))))
+ (signal-condition! search-defined)
+ (put! server (datum->insertion datum))
+ (wait done)
+ #true)))
+
(test-end)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.