-
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #602 from nix-community/shell-wrapper-race-condition
fix: shell-wrapper sometimes can't launch wrapped shell due to race condition
- Loading branch information
Showing
4 changed files
with
70 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ pkgs, lib, ... }: | ||
|
||
{ | ||
imports = [ | ||
<nixos-wsl/modules> | ||
]; | ||
|
||
wsl.enable = true; | ||
|
||
system.activationScripts."00-delay" = '' | ||
echo "Delaying activation for 15 seconds..." | ||
sleep 15s | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
BeforeAll { | ||
. $PSScriptRoot/../lib/lib.ps1 | ||
} | ||
|
||
Describe "Slow Activation Script" { | ||
BeforeAll { | ||
$distro = [Distro]::new() | ||
} | ||
|
||
It "should not cause starting a shell to fail" { | ||
$distro.InstallConfig("$PSScriptRoot/delay-activation.nix", "boot") | ||
$distro.Shutdown() | ||
|
||
$distro.Launch("echo 'TEST'") | Select-Object -Last 1 | Tee-Object -Variable output | ||
$output | Should -BeExactly "TEST" | ||
$LASTEXITCODE | Should -Be 0 | ||
} | ||
|
||
AfterAll { | ||
$distro.Uninstall() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters