<commit_before>hab pkg install core/nginx --channel stable
hab pkg install core/windows-service

Describe "Clean Habitat Shutdown" {
    Start-Service Habitat
    hab pkg install core/nginx
    Wait-Supervisor -Timeout 45
    hab svc load core/nginx
    Wait-SupervisorService nginx -Timeout 20
    It "Starts running nginx" {
        # This will error with a 403 because nginx is not running any sites
        try  { Invoke-WebRequest "http://localhost" }
        catch [Microsoft.PowerShell.Commands.HttpResponseException] { $headers = $_.Exception.Response.Headers }
        [string]$headers.Server | Should -BeLike "nginx/*"
        Test-Path C:\hab\svc\nginx\PID | Should -Be $true
    }
    It "Stops all processes" {
        Stop-Service Habitat
        Get-Process hab-sup -ErrorAction SilentlyContinue | Should -Be $null
        Get-Process hab-launch -ErrorAction SilentlyContinue | Should -Be $null
        Get-Process nginx -ErrorAction SilentlyContinue | Should -Be $null
        Test-Path C:\hab\svc\nginx\PID | Should -Be $false
    }
}<commit_msg>Don't test for a PID file, because they no longer exist<commit_after>hab pkg install core/nginx --channel stable
hab pkg install core/windows-service

Describe "Clean Habitat Shutdown" {
    Start-Service Habitat
    hab pkg install core/nginx
    Wait-Supervisor -Timeout 45
    hab svc load core/nginx
    Wait-SupervisorService nginx -Timeout 20
    It "Starts running nginx" {
        # This will error with a 403 because nginx is not running any sites
        try  { Invoke-WebRequest "http://localhost" }
        catch [Microsoft.PowerShell.Commands.HttpResponseException] { $headers = $_.Exception.Response.Headers }
        [string]$headers.Server | Should -BeLike "nginx/*"
    }
    It "Stops all processes" {
        Stop-Service Habitat
        Get-Process hab-sup -ErrorAction SilentlyContinue | Should -Be $null
        Get-Process hab-launch -ErrorAction SilentlyContinue | Should -Be $null
        Get-Process nginx -ErrorAction SilentlyContinue | Should -Be $null
    }
}
{'fraction_non_alphanumeric': 0.0848366650414432, 'fraction_numerical': 0.006825938566552901, 'mean_word_length': 2.8790170132325144, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1786051', 'n_tokens_mistral': 613, 'n_tokens_neox': 576, 'n_words': 192}