anchor.diff:          });
         }).catchError((e) {
           // "Connection actively refused by host" errors are handled here.
  -        errorCount++;
  +        earlyErrorCount++;
           checkDone();
         });
       }
  
positive.code:   var doneCount = 0;
    var closeCount = 0;
    var errorCount = 0;
  
    ReceivePort port = new ReceivePort();
  
  
negative.code:     Expect.isTrue(server.port > 0);
  
      void checkDone() {
        if (doneCount + earlyErrorCount == socketCount &&
            closeCount + errorCount + earlyErrorCount == socketCount) {
          port.close();
        }
      }
  