Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test: Fix scaletest/reconnectingpty commands for use in powershell #5439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 16, 2022

Conversation

mafredri
Copy link
Member

@mafredri mafredri commented Dec 15, 2022

I'm confused as to why this works in CI, the default shell must be bash. In my Windows VM, I'm unable to successfully run the tests because powershell is spawned.

This fix only fixes powershell, cmd.exe won't sleep it'll just echo the line including ; sleep 1. For cmd.exe the && works, but needs to use timeout 1 instead.

Perhaps we should explicitly invoke a shell, depending on platform, to control the parsing/execution?

PS C:\Users\ZeroCool> echo 'hello world' && sleep 1
At line:1 char:19
+ echo 'hello world' && sleep 1
+                   ~~
The token '&&' is not a valid statement separator in this version.
    + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : InvalidEndOfLine

@mafredri mafredri self-assigned this Dec 15, 2022
@mafredri mafredri merged commit e2aec27 into main Dec 16, 2022
@mafredri mafredri deleted the mafredri/test-fix-command-for-powershell branch December 16, 2022 10:18
@github-actions github-actions bot locked and limited conversation to collaborators Dec 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants