anchor.diff:  run_test(Config, Extra, Body) ->
       run_test(Config, Extra, {cres,Body,[]}).
   
  -wait_for_expected(R, Before, SourceFile, Wait) ->
  +wait_for_expected(R, {Strict0,PPS0}=Before, SourceFile, Wait) ->
       Ms = erlang:process_info(self(),messages),
  -    After = {get(), pps(), ets:all(), Ms},
  +    After = {_,PPS1} = {{get(), ets:all(), Ms}, pps()},
       case {R, After} of
           {ok, Before} ->
               ok;
  +        {ok, {Strict0,_}} ->
  +            {Ports0,Procs0} = PPS0,
  +            {Ports1,Procs1} = PPS1,
  +            case {Ports1 -- Ports0, Procs1 -- Procs0} of
  +                {[], []} -> ok;
  +                _ when Wait ->
  +                    timer:sleep(1000),
  +                    wait_for_expected(R, Before, SourceFile, false);
  +                {PortsDiff,ProcsDiff} ->
  +                    io:format("failure, got ~p~n, expected ~p\n",
  +                              [PPS1, PPS0]),
  +                    show("Old port", Ports0 -- Ports1),
  +                    show("New port", PortsDiff),
  +                    show("Old proc", Procs0 -- Procs1),
  +                    show("New proc", ProcsDiff),
  +                    fail(SourceFile)
  +            end;
           _ when Wait ->
               timer:sleep(1000),
               wait_for_expected(R, Before, SourceFile, false);
  
positive.code:     {module, _} = code:load_abs(AbsFile, Mod),
  
      Ms0 = erlang:process_info(self(),messages),
      Before = {get(), pps(), ets:all(), Ms0},
  
      %% Prepare the check that the qlc module does not call qlc_pt.
      _ = [unload_pt() || {file, Name} <- [code:is_loaded(qlc_pt)], 
  
negative.code: filename(Name, Config) ->
      filename:join(?privdir, Name).
  
  show(_S, []) ->
      ok;
  show(S, [{Pid, Name, InitCall}|Pids]) when is_pid(Pid) ->
      io:format("~s: ~w (~w), ~w: ~p~n",
                [S, Pid, proc_reg_name(Name), InitCall,
                 erlang:process_info(Pid)]),
      show(S, Pids);
  show(S, [{Port, _}|Ports]) when is_port(Port)->
      io:format("~s: ~w: ~p~n", [S, Port, erlang:port_info(Port)]),
      show(S, Ports).
  
  pps() ->
      {port_list(), process_list()}.
  
  