-
Notifications
You must be signed in to change notification settings - Fork 0
/
SimulateNewNodeNotJoining.ps1
41 lines (30 loc) · 1.17 KB
/
SimulateNewNodeNotJoining.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
$currentLocation = Get-Location
$configuration='Release'
$pathToExe = "$currentLocation\AkkaStreamsAndSharding\bin\$configuration\net5.0\AkkaStreamsAndSharding.exe"
if (-not(Test-Path $pathToExe)) {
echo "Running msbuild..."
msbuild -p:RestorePackagesConfig=true -t:restore /m:4 /t:build /p:Configuration=$configuration /p:Optimize=True "AkkaStreamsAndSharding.sln"
}
echo $pathToExe
#Start first instance
Start-Process -FilePath $pathToExe -ArgumentList "5005 true 200 5s"
Start-Sleep -Milliseconds 500
$wshell = New-Object -ComObject wscript.shell
$wshell.AppActivate('AkkaStreamsAndSharding.exe5005')
#Start node 1
Start-Sleep -Milliseconds 100
$wshell.SendKeys('1')
#Start sending input to cluster
Start-Sleep -Milliseconds 100
$wshell.SendKeys('2')
#Wait for all actors to be created on node 1
Start-Sleep -Milliseconds 10000
#Start node 1
Start-Process -FilePath $pathToExe -ArgumentList "5006 false 200 5s"
Start-Sleep -Milliseconds 500
$wshell = New-Object -ComObject wscript.shell
$wshell.AppActivate('AkkaStreamsAndSharding.exe5006')
#Start node 2
Start-Sleep -Milliseconds 100
$wshell.SendKeys('1')
#Node 2 is marked as unresponsive (auto-down-unreachable-after = 5s)