Skip to content

Commit 72b042e

Browse files
committed
fix test
1 parent c8b34e3 commit 72b042e

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

tests/actor-test.lisp

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -505,31 +505,14 @@
505505
"Tests that actor's queue size can be limited."
506506
(let ((sys (asys:make-actor-system)))
507507
(unwind-protect
508-
(let* ((counter 0)
509-
(actor (actor-of sys
508+
(let* ((actor (actor-of sys
510509
:receive (lambda (msg)
511-
(declare (ignore msg))
512-
(sleep 0.1)
513-
(incf counter)
514-
(reply t))
510+
(declare (ignore msg)))
515511
:queue-size 1))
516-
(futures
517-
(loop repeat 10
518-
collect (ask actor "run") into futures
519-
finally
520-
(is-true (await-cond 2
521-
(every #'complete-p
522-
futures)))
523-
(return futures))))
524-
525-
(is (= 1 counter)
526-
"Counter was incremented more then 1 time, it's value is ~A"
527-
counter)
528-
529-
(let ((queue-full-counter
530-
(length (remove-if-not #'error-p
531-
futures))))
532-
(is (= 9 queue-full-counter)
533-
"Counter of unsuccessful attempts should be equal to 9, but it is ~A"
534-
queue-full-counter)))
512+
(tells
513+
(loop :repeat 10
514+
:collect (ignore-errors
515+
(tell actor "run")))))
516+
(is (= 1 (length (mapcan (lambda (x) (if x (list x))) tells))))
517+
(is (= 9 (length (mapcan (lambda (x) (if (null x) (list x))) tells)))))
535518
(ac:shutdown sys))))

0 commit comments

Comments
 (0)