Add test for lp#1760827 [was: Policy for adding marked-as-failing tests (= without a fix)?]

Andreas Franke via Sbcl-devel <[email protected]>
Newsgroups gmane.lisp.steel-bank.devel
Message-ID <trinity-fb8c88eb-9c81-41d0-bfb1-9e1e5bf06635-1769835782374@trinity-msg-rest-gmx-gmx-live-6fb44d8b58-jlhrg>
Could we make a decision here please?
- Is lp#1760827 a valid issue?
- Can we add a failing test already, so as to inspire 
  some confidence that it is somehow possible to 
  create a fix that will be acceptable for merging?
  (See attachment for an example test.)

> [...] policy [for] when a new
> test pointing out a problem/limitation/flaw/issue in sbcl 
> may be considered acceptable for merging?
> 
> Naively, I had assumed that under almost any circumstance,
> having a marked-as-failing new test in-tree is strictly 
> better than not having it [...]

_______________________________________________
Sbcl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-devel
condition-wait.impure.lisp (text/x-common-lisp, 1.8 KB)
;;;; tests for condition-wait timeout behavior

;;;; This software is part of the SBCL system. See the README file for
;;;; more information.
;;;;
;;;; While most of SBCL is derived from the CMU CL system, the test
;;;; files (like this one) were written from scratch after the fork
;;;; from CMU CL.
;;;;
;;;; This software is in the public domain and is provided with
;;;; absolutely no warranty. See the COPYING and CREDITS files for
;;;; more information.

(require :sb-concurrency)

(with-test (:name (:wait-on-gate :timeout))
  (let* ((gate (sb-concurrency:make-gate))
         (elapsed nil)
         (thread (sb-thread:make-thread
                   (lambda ()
                     (let ((start (get-internal-real-time)))
                       (sb-concurrency:wait-on-gate gate :timeout 0.5)
                       (setf elapsed (/ (- (get-internal-real-time) start)
                                        internal-time-units-per-second)))))))
    (sb-thread:join-thread thread :timeout 5)
    (assert (<= 0.3 elapsed 1.0))))

(with-test (:name (:wait-on-gate :timeout :with-gc)
            :fails-on :sbcl)
  ;; Bug #1760827: timeout may never occur with frequent GC interrupts.
  (let* ((gate (sb-concurrency:make-gate))
         (deadline-hit nil)
         (thread (sb-thread:make-thread
                   (lambda ()
                     (sb-concurrency:wait-on-gate gate :timeout 1.0)))))
    (handler-case
        (sb-sys:with-deadline (:seconds 5)
          (loop while (sb-thread:thread-alive-p thread)
                do (sb-ext:gc)
                   (sleep 0.5)))
      (sb-sys:deadline-timeout ()
        (setf deadline-hit t)))
    (sb-thread:join-thread thread :timeout 10)
    (assert (not deadline-hit) ()
            "Wait-on-gate did not complete within 5 seconds (bug #1760827)")))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.