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

integration-cli: update TestCreateWithWorkdir for Hyper-V isolation #39876

Merged
merged 1 commit into from
Sep 20, 2019

Conversation

thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Sep 7, 2019

(taken from #39846)

Hyper-V isolated containers do not allow file-operations on a running container. This test currently uses docker cp to verify that the WORKDIR was automatically created, which cannot be done while the container is running.

FAIL: docker_cli_create_test.go:302: DockerSuite.TestCreateWithWorkdir

assertion failed:
Command:  d:\CI-7\CI-f3768a669\binary\docker.exe cp foo:c:\home\foo\bar c:\tmp
ExitCode: 1
Error:    exit status 1
Stdout:
Stderr:   Error response from daemon: filesystem operations against a running Hyper-V container are not supported

Failures:
ExitCode was 1 expected 0
Expected no error

@thaJeztah
Copy link
Member Author

@StefanScherer @vikramhh ptal

Copy link

@vikramhh vikramhh left a comment

Choose a reason for hiding this comment

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

Is it possible that on some [slow or heavily loaded] machines, the container may not stop in time for the next check in line 321?

@thaJeztah
Copy link
Member Author

Is it possible that on some [slow or heavily loaded] machines, the container may not stop in time for the next check in line 321?

docker stop is synchronous, so it should wait for the container to stop;

# container runs a shell to mimic a slow stopping container (will ignore SIGTERM, and be SIGKILL'd after 10 seconds)
docker run -dit --rm --name foobar busybox 

# time how long it takes to stop; you can see it waits for 10 seconds+
time -p docker stop foobar

real        10.67
user         0.03
sys          0.01

@cpuguy83
Copy link
Member

This is funny because I believe we use cp because Windows did not support docker exec at one point.

@cpuguy83
Copy link
Member

Looks like we have a flakey unit test:

[2019-09-07T16:05:12.423Z] === Failed

[2019-09-07T16:05:12.423Z] === FAIL: daemon/logger/loggerutils TestFollowLogsProducerGone (30.00s)

[2019-09-07T16:05:12.423Z]     logfile_test.go:133: logDecode() closed after sending 1 messages

[2019-09-07T16:05:12.423Z]     logfile_test.go:186: timeout waiting for log messages to be read (sent: 1, received: 1

@cpuguy83
Copy link
Member

And one on Windows, unrelated:

[2019-09-07T17:43:09.140Z] ----------------------------------------------------------------------

[2019-09-07T17:43:09.140Z] FAIL: docker_cli_start_test.go:190: DockerSuite.TestStartReturnCorrectExitCode

[2019-09-07T17:43:09.140Z] 

[2019-09-07T17:43:09.140Z] docker_cli_start_test.go:200:

[2019-09-07T17:43:09.140Z]     c.Assert(exitCode, checker.Equals, 12, check.Commentf("out: %s", out))

[2019-09-07T17:43:09.140Z] ... obtained int = 125

[2019-09-07T17:43:09.140Z] ... expected int = 12

[2019-09-07T17:43:09.140Z] ... out: time="2019-09-07T17:43:07Z" level=error msg="error waiting for container: EOF" 

[2019-09-07T17:43:09.140Z] 

[2019-09-07T17:43:09.140Z] 

[2019-09-07T17:43:09.140Z] 

[2019-09-07T17:43:09.140Z] ----------------------------------------------------------------------

Hyper-V isolated containers do not allow file-operations on a
running container. This test currently uses `docker cp` to verify
that the WORKDIR was automatically created, which cannot be done
while the container is running.

```
FAIL: docker_cli_create_test.go:302: DockerSuite.TestCreateWithWorkdir

assertion failed:
Command:  d:\CI-7\CI-f3768a669\binary\docker.exe cp foo:c:\home\foo\bar c:\tmp
ExitCode: 1
Error:    exit status 1
Stdout:
Stderr:   Error response from daemon: filesystem operations against a running Hyper-V container are not supported

Failures:
ExitCode was 1 expected 0
Expected no error
```

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Member Author

@cpuguy83 updated; ptal

Copy link
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants