File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/test/kotlin/com/atlassian/performance/tools/ssh/api Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ class SshTest {
5656 SshContainer ().useSsh { sshHost ->
5757 installPing(sshHost)
5858
59- val fail = sshHost.runInBackground(" nonexistent-command" )
59+ val fail = sshHost.runInBackground(" nonexistant-command" )
60+ sshHost.waitForAllProcessesToFinish(" nonexistant-command" , Duration .ofMillis(100 ))
6061 val failResult = fail.stop(Duration .ofMillis(20 ))
6162
6263 Assert .assertEquals(127 , failResult.exitStatus)
@@ -66,4 +67,11 @@ class SshTest {
6667 private fun installPing (sshHost : Ssh ) {
6768 sshHost.newConnection().use { it.execute(" apt-get update -qq && apt-get install iputils-ping -y" ) }
6869 }
70+
71+ private fun Ssh.waitForAllProcessesToFinish (
72+ processCommand : String ,
73+ timeout : Duration
74+ ) = this .newConnection().use {
75+ it.execute(" wait `pgrep '$processCommand '`" , timeout)
76+ }
6977}
You can’t perform that action at this time.
0 commit comments