<commit_before>namespace Nessos.Thespian.Cluster.Tests

open System
open System.Diagnostics
open Nessos.Thespian
open Nessos.Thespian.Utils.Async
open Nessos.Thespian.Remote
open Nessos.Thespian.Cluster

type Node() =
    let mutable killed = false
    
    let onMono = match Type.GetType("Mono.Runtime") with
                 | null -> false
                 | _ -> true
            
    let executable =
        let location = System.Reflection.Assembly.GetExecutingAssembly().Location
        System.IO.Path.Combine(System.IO.Path.GetDirectoryName(location), "Thespian.TestCluster.exe")
    let command =
        if onMono then "mono"
        else executable

    let receiver = Receiver.create()
                   |> Receiver.publish [Protocols.utcp()]
                   |> Receiver.start
    let receiverUri = ActorRef.toUri receiver.Ref
    let awaitNodePort = Async.AwaitObservable(receiver |> Receiver.toObservable, 10000)

    let args =
        if onMono then
            executable + " " + receiverUri
        else receiverUri

    let startInfo = new ProcessStartInfo(command, args)

    let osProcess =
        startInfo.UseShellExecute <- false
        startInfo.CreateNoWindow <- true
        startInfo.RedirectStandardOutput <- true
        startInfo.RedirectStandardError <- true

        Process.Start(startInfo)
<commit_msg>Fixed TestCluster.exe path in tests.<commit_after>namespace Nessos.Thespian.Cluster.Tests

open System
open System.Diagnostics
open Nessos.Thespian
open Nessos.Thespian.Utils.Async
open Nessos.Thespian.Remote
open Nessos.Thespian.Cluster

type Node() =
    let mutable killed = false
    
    let onMono = match Type.GetType("Mono.Runtime") with
                 | null -> false
                 | _ -> true
            
    let executable = System.IO.Path.Combine(System.IO.Directory.GetCurrentDirectory(), "Thespian.TestCluster.exe")
    
    let command =
        if onMono then "mono"
        else executable

    let receiver = Receiver.create()
                   |> Receiver.publish [Protocols.utcp()]
                   |> Receiver.start
    let receiverUri = ActorRef.toUri receiver.Ref
    let awaitNodePort = Async.AwaitObservable(receiver |> Receiver.toObservable, 10000)

    let args =
        if onMono then
            executable + " " + receiverUri
        else receiverUri

    let startInfo = new ProcessStartInfo(command, args)

    let osProcess =
        startInfo.UseShellExecute <- false
        startInfo.CreateNoWindow <- true
        startInfo.RedirectStandardOutput <- true
        startInfo.RedirectStandardError <- true

        Process.Start(startInfo)

{'fraction_non_alphanumeric': 0.08098859315589353, 'fraction_numerical': 0.0038022813688212928, 'mean_word_length': 2.39922480620155, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2645218', 'n_tokens_mistral': 768, 'n_tokens_neox': 726, 'n_words': 167}