anchor.diff:      ctx.printfn "A guid %A" (ng()))
   
   let maxDOP = 30
  -run maxDOP
  -
  -System.Console.ReadKey() |> ignore
  +let failedTest = run maxDOP
  +printfn "final failed count %A" failedTest
  
positive.code: let newManager maxDOP : actor<Manager> =
    let sw = System.Diagnostics.Stopwatch.StartNew()
    actor.Start(fun self ->
      let rec loop workers maxWorkers doneWorkers =
        async {
          let! msg = self.Receive ()
          match msg with
          | Manager.Initialize (suites) ->
            //build a worker per suite/test combo and give them their work
            let workers = suites |> List.map (fun suite -> suite.Tests |> List.map (fun test -> newWorker self test)) |> List.concat |> List.rev
            return! loop workers workers.Length 0
          | Manager.Start ->
            //kick off the initial X workers
            self.Post(Manager.Run maxDOP)
            return! loop workers maxWorkers doneWorkers
          | Manager.Run(count) ->
            if count = 0 then
              return! loop workers maxWorkers doneWorkers
            else
              match workers with
              | [] -> return! loop [] maxWorkers doneWorkers
              | head :: tail ->
                head.Post(Worker.Run)
                self.Post(Manager.Run(count - 1))
                return! loop tail maxWorkers doneWorkers
          | Manager.WorkerDone ->
            self.Post(Manager.Run(1))
            let doneWorkers = doneWorkers + 1
            if doneWorkers = maxWorkers then
              reporter.Post(Reporter.RunOver(int sw.Elapsed.TotalMinutes, int sw.Elapsed.TotalSeconds))
              return ()
            else
              return! loop workers maxWorkers doneWorkers
        }
      loop [] 0 0)
  
  let run maxDOP =
    // suites list is in reverse order and have to be reversed before running the tests
    suites <- List.rev suites
    let manager = newManager maxDOP
    manager.Post(Manager.Initialize(suites))
    manager.Post(Manager.Start)
  
  //demo
  context "Test Context"
  
negative.code: 
  type Manager =
    | Initialize of Suite list
    | Start of AsyncReplyChannel<int>
    | Run of count:int
    | WorkerDone
  
  