Skip to content
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

Fix exec test on windows #519

Merged
merged 1 commit into from
Aug 31, 2019

Conversation

Random-Liu
Copy link
Contributor

@Random-Liu Random-Liu commented Aug 30, 2019

For containerd/cri#1257

There are several problems with the original test:

  1. IIUC, it should use select instead of switch;
  2. Only checking len(localOut.String()) >= len(stdout) can't make sure that the exec is done. For tty=true and stdin=true test, closing the stdin will terminate the test exec;
  3. The len(localOut.String()) >= len(stdout) logic doesn't work on windows. On windows, when tty is enabled, a lot of control characters will be generated before the actual output, e.g.:
�[2J�[?25l�[m�[H























�[H�]0;C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ��[?25h �[H�]0;Administrator: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe ��[?25lhello ��[?25h�[?25l�[Hh
�[?25h�[Hh

Signed-off-by: Lantao Liu lantaol@google.com

Signed-off-by: Lantao Liu <lantaol@google.com>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Random-Liu

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 30, 2019
Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 31, 2019
@k8s-ci-robot k8s-ci-robot merged commit 8c8c91c into kubernetes-sigs:master Aug 31, 2019
@Random-Liu Random-Liu deleted the fix-exec-test branch September 1, 2019 00:48
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants