Because we save the args in the trial for rerunning. DYNAMIC-EXTENT does not work either.
Portable seeding?
That is, instead of DEBUG we could say (UNEXPECTED-FAILURE #’INVOKE-DEBUGGER) or (UNEXPECTED-FAILURE nil) and establish our own handler outside TRY.
Add more vars to WITH-STD-TRY. Actually, use DEFVAR* to capture those defaults according to OAOO.
Or, just make the global binding immutable?
- State “CANCELLED” from “MAYBE” [2023-08-05 Sat 09:32]
(with-test (t0) (adopting (c0) (make-thread (lambda() (reparenting (t0 c0) (with-test (t1) …))))))
- ADOPTING binds C0 to a semaphore. REPARENTING arranges for T1 to be added to a dedicated slot (ADOPTEES) in T0 in a thread safe manner and signals C0 when it’s done. CHILDREN continues to be accessed without synchronization overhead.
- ADOPTING captures the relevant dynamic environment, and REPARENTING reinstates it.
- ADOPTING waits on the semaphores it created at the end.
- There may be REPARENTINGs without semaphores. ADOPTING cannot wait for those, and it is the user’s responsibility to synchronize.
- Printing semantics are nasty. Events must be printed at the latest when the debugger is entered, so maybe print with thread ids? Use different printer objects to keep things simple. This maintains simple nesting structure in TRIALs and CHILDREN but breaks nesting in the output, of course.
- The ordering of events is lost (some are in CHILDREN some in ADOPTEES). Printed output cannot be reproduced on reruns. Rerunning semantics is a headache more generally. This is not great.
Maybe it’s better to provide a simple macro that waits for threads created with a timeout and leaves it to the user to perform the checks in the right thread. The problem is that which threads to wait for cannot be decided automatically.
Provide opt out from LIST-ALL-PACKAGE-TESTS? Maybe tags?
There should be a trace of what happened in the counts.
I don’t know how. See TRY::EXPAND-WITH-TRIAL-IN-DEFTEST-P.
PAX has MARK-THIS-SOURCE-LOCATION.
Some of this is taken care of by rerunning (e.g. (FUNCALL !)), which will likely land in the debugger, and that has source location info.
CCL for example [handle][clhs]s even user-signalled warnings during compilation. Textual matching?
It is easy to get into a infinite loop with :HANDLER #’CONTINUE.