<commit_before>using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;

namespace dotnetsheff.Api.FunctionalTests
{
    public class AzureFunctionsStartup
    {
        private Process _process;
        private readonly int _port;
        private readonly string _meetupApiBaseUri;
        private readonly string _meetupApiKey;

        public AzureFunctionsStartup(int port, string meetupApiBaseUri, string meetupApiKey)
        {
            _port = port;
            _meetupApiBaseUri = meetupApiBaseUri;
            _meetupApiKey = meetupApiKey;
        }

        public void Start()
        {   
            var currentDir = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;
            var index = currentDir.LastIndexOf("\\bin\\");
            var projectDir = currentDir.Remove(index);
            var solutionDir = Directory.GetParent(projectDir).Parent.FullName;
            var mode = "Debug";

#if (!DEBUG)
            mode = "Release";
#endif
            var funcCliExe = Path.Combine(Environment.GetFolderPath(
                Environment.SpecialFolder.ApplicationData), @"npm\func.cmd");
            
            var processStartInfo = new ProcessStartInfo
            {
                FileName = funcCliExe,
                Arguments = $"host start -p {_port}",
                WorkingDirectory =$@"{solutionDir}\src\dotnetsheff.Api\bin\{mode}\net462\",
                WindowStyle = ProcessWindowStyle.Normal,
                UseShellExecute = false,
            };

            processStartInfo.EnvironmentVariables["AzureWebJobsStorage"] = "UseDevelopmentStorage=true";
            processStartInfo.EnvironmentVariables["AzureWebJobsDashboard"] = "UseDevelopmentStorage=true";
            processStartInfo.EnvironmentVariables["MeetupApiBaseUri"] = _meetupApiBaseUri;
            processStartInfo.EnvironmentVariables["MeetupApiKey"] = _meetupApiKey;

            _process = Process.Start(processStartInfo);

            Thread.Sleep(1000);
        }

        public void Stop()
        {
            var processesByName = Process.GetProcessesByName("func");
            foreach (var process in processesByName)
            {
                process.Kill();
            }
        }
    }
}<commit_msg>delaying the startup of functional tests a bit longer.<commit_after>using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;

namespace dotnetsheff.Api.FunctionalTests
{
    public class AzureFunctionsStartup
    {
        private Process _process;
        private readonly int _port;
        private readonly string _meetupApiBaseUri;
        private readonly string _meetupApiKey;

        public AzureFunctionsStartup(int port, string meetupApiBaseUri, string meetupApiKey)
        {
            _port = port;
            _meetupApiBaseUri = meetupApiBaseUri;
            _meetupApiKey = meetupApiKey;
        }

        public void Start()
        {   
            var currentDir = new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath;
            var index = currentDir.LastIndexOf("\\bin\\");
            var projectDir = currentDir.Remove(index);
            var solutionDir = Directory.GetParent(projectDir).Parent.FullName;
            var mode = "Debug";

#if (!DEBUG)
            mode = "Release";
#endif
            var funcCliExe = Path.Combine(Environment.GetFolderPath(
                Environment.SpecialFolder.ApplicationData), @"npm\func.cmd");
            
            var processStartInfo = new ProcessStartInfo
            {
                FileName = funcCliExe,
                Arguments = $"host start -p {_port}",
                WorkingDirectory =$@"{solutionDir}\src\dotnetsheff.Api\bin\{mode}\net462\",
                WindowStyle = ProcessWindowStyle.Normal,
                UseShellExecute = false,
            };

            processStartInfo.EnvironmentVariables["AzureWebJobsStorage"] = "UseDevelopmentStorage=true";
            processStartInfo.EnvironmentVariables["AzureWebJobsDashboard"] = "UseDevelopmentStorage=true";
            processStartInfo.EnvironmentVariables["MeetupApiBaseUri"] = _meetupApiBaseUri;
            processStartInfo.EnvironmentVariables["MeetupApiKey"] = _meetupApiKey;

            _process = Process.Start(processStartInfo);

            Thread.Sleep(2000);
        }

        public void Stop()
        {
            var processesByName = Process.GetProcessesByName("func");
            foreach (var process in processesByName)
            {
                process.Kill();
            }
        }
    }
}
{'fraction_non_alphanumeric': 0.08570188761119549, 'fraction_numerical': 0.0030375352571056628, 'mean_word_length': 2.201388888888889, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7486606', 'n_tokens_mistral': 1226, 'n_tokens_neox': 1144, 'n_words': 232}