[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 203/324: tests/mq-stream: Make tests less fragile.
From: |
gnunet |
Subject: |
[gnunet-scheme] 203/324: tests/mq-stream: Make tests less fragile. |
Date: |
Tue, 21 Sep 2021 13:24:03 +0200 |
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 38b38a8c1be27bc97cd54d3612c1cedf6ddf4198
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sat Aug 28 12:07:52 2021 +0200
tests/mq-stream: Make tests less fragile.
With ‘fragility’ I mean ‘tests sometimes succeeding when they should
fail’ here.
* tests/mq-stream.scm
("input eof detected --> handle-input/output! stops
(port->message-queue)")
("closed for writing --> handle-input! stops (port->message-queue)")
("closed for writing --> handle-input! stops (port->message-queue)")
("writer blocking and closed for reading --> all fibers stop"):
Use 'call-with-spawner/wait', #:parallelism 1, and don't bother with
#:drain?.
---
tests/mq-stream.scm | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/tests/mq-stream.scm b/tests/mq-stream.scm
index ce53f2e..ff64e17 100644
--- a/tests/mq-stream.scm
+++ b/tests/mq-stream.scm
@@ -490,7 +490,7 @@
(values (car sp) (cdr sp)))
(test-assert "input eof detected --> handle-input/output! stops
(port->message-queue)"
- (call-with-spawner
+ (call-with-spawner/wait
(lambda (spawn)
(define-values (alpha beta) (two-sockets))
(define end-of-file (make-condition))
@@ -524,14 +524,11 @@
;; If it didn't try to sent the message, that presumably means the
;; 'handle-output!' fiber has completed.
#t)
- ;; Wait until all runnable fibers complete
- ;; -- TODO this does not seem to include blocking handle-input/output!.
- #:drain? #t
- ;; drain? is broken when parallelism is enabled, see <???>.
+ ;; Should make 'yield-many' less fragile.
#:parallelism 1))
(test-assert "closed for writing --> handle-input! stops (port->message-queue)"
- (call-with-spawner
+ (call-with-spawner/wait
(lambda (spawn)
(define-values (alpha beta) (two-sockets))
(define received? (make-atomic-box #f))
@@ -574,7 +571,7 @@
(yield-many)
(sleep 0.1) ; might not be necessary anymore
#t)
- #:drain? #t
+ ;; Should make 'yield-many' less fragile.
#:parallelism 1))
;; This detects the absence of the parametrisation of 'current-write-waiter'.
@@ -618,7 +615,9 @@
(yield-many)
(sleep 0.1)
(shutdown alpha 0)
- #t)))
+ #t)
+ ;; Should make 'yield-many' less fragile.
+ #:parallelism 1))
;; ^ if this test blocks, that means not all fibers have stopped
(test-end "mq-stream")
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet-scheme] 186/324: nse: Allow 'updated' to be absent., (continued)
- [gnunet-scheme] 186/324: nse: Allow 'updated' to be absent., gnunet, 2021/09/21
- [gnunet-scheme] 166/324: guix: Use fixed version of guile., gnunet, 2021/09/21
- [gnunet-scheme] 176/324: tests/utils: New utilities for tests., gnunet, 2021/09/21
- [gnunet-scheme] 172/324: crypto/struct: Define /ecc-signature-purpose., gnunet, 2021/09/21
- [gnunet-scheme] 179/324: nse/struct: Document 'timestamp' field of estimates., gnunet, 2021/09/21
- [gnunet-scheme] 192/324: tests/mq-stream: Recognise the 'input:regular-end-of-file' error., gnunet, 2021/09/21
- [gnunet-scheme] 206/324: mq-impl/stream: Flush the output port regularily., gnunet, 2021/09/21
- [gnunet-scheme] 198/324: doc: Document dependencies and how to get the source code., gnunet, 2021/09/21
- [gnunet-scheme] 202/324: mq-impl/stream: Allow the write fiber to stop even if blocking., gnunet, 2021/09/21
- [gnunet-scheme] 205/324: tests/mq-stream: Unbreak SIGPIPE signal handler., gnunet, 2021/09/21
- [gnunet-scheme] 203/324: tests/mq-stream: Make tests less fragile.,
gnunet <=
- [gnunet-scheme] 193/324: mq-impl/stream: Eliminate condition variable., gnunet, 2021/09/21
- [gnunet-scheme] 207/324: hat-let: Allow (dotted) variable lists with <--., gnunet, 2021/09/21
- [gnunet-scheme] 211/324: doc: Correct typo (mesage -> message), gnunet, 2021/09/21
- [gnunet-scheme] 215/324: tests/mq-stream: Use 'message-handler' macro., gnunet, 2021/09/21
- [gnunet-scheme] 218/324: mq-impl/stream: Name the reader and writer thunks., gnunet, 2021/09/21
- [gnunet-scheme] 208/324: tests/mq-stream: Don't assume setvbuf returns anything., gnunet, 2021/09/21
- [gnunet-scheme] 212/324: mq/handler: Define a macro for constructing handlers., gnunet, 2021/09/21
- [gnunet-scheme] 220/324: mq-impl/stream: Extract code to be shared with connect/fibers., gnunet, 2021/09/21
- [gnunet-scheme] 226/324: doc: Generate PDF and HTML documentation, gnunet, 2021/09/21
- [gnunet-scheme] 227/324: mq: Remove TODOs about hypothetical &malformed-message., gnunet, 2021/09/21