if docker exec exit and at the same the the container is pause,
there could be a chance the `docker exec exit` will fail
```
$ docker exec -ti 388c7f47a06c sh
/ # exit
Error response from daemon: Container 388c7f47a06cce0856266ffd56a2ce2901689ca7a6b9cd741b37652418448f2b is paused, unpause the container before exec
```
To reproduce this error easilly, we can add a sleep in `containerPause`
```
--- a/daemon/pause.go
+++ b/daemon/pause.go
@@ -2,6 +2,7 @@ package daemon
import (
"fmt"
+ "time"
"github.com/docker/docker/container"
)
@@ -25,7 +26,7 @@ func (daemon *Daemon) ContainerPause(name string) error {
func (daemon *Daemon) containerPause(container *container.Container) error {
container.Lock()
defer container.Unlock()
-
+ time.Sleep(time.Second * 5)
// We cannot Pause the container which is not running
if !container.Running {
return errNotRunning{container.ID}
```
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 0e87588bbb2482f9635a19ac43be1c0ee9652ac2
Component: engine
Also, chained/quoted shell does not work
Signed-off-by: Julien Maitrehenry <julien.maitrehenry@me.com>
Upstream-commit: 3f6e861c14bf13bb5b43aacb9edfbb027d6b6903
Component: engine
These tests were caught in the crossfire of the transition to testify.
testify has a few subtle differences from the similar custom framework
it replaced:
- Error behaves differently
- Equal takes its arguments in a different order
This PR also takes the opportunity to use a few shorthands from testify,
such as Len, True, and False.
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: acc2d5b7d6817dd8b256e4d7f3a5ca1f207e327f
Component: engine
This test shuts down two out of three managers and then asserts that the
swarm has a leader. A swarm that lost quorum won't necessarily have a
leader, and in this case only has one because the old leader is still
around. Soon SwarmKit will be changed so the leader gives up leadership
when quorum is lost. This will avoid confusing situations, like
read-only APIs succeeding, while ones that write to Raft hang.
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: c27603238c5493909ec9b657b342b67b23e615e3
Component: engine
Mostly, they always have been. Most regular expressions were implemented
as `[\w][\w.-]{0,127]`, which actually allows 128 characters, since we
start with a character in the first expression.
This "fact" has been backported to the existing specifications where
length is mentioned. For the most part, no ill-effects should come of
this, unless someone has optimized to hold the length of a tag in a 7
bit integer.
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: c9beb417f46a3a0d06a89c67b134cd399a7b948b
Component: engine
In preparation for removing it from builder.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 52626bb9199ca3562fa70f14d8fc7b8c12c8b0f5
Component: engine
This change starts the process of splitting up the Builder into logical
components. Remove builder.flags and move it to the new dispatchRequest
object.
Use runConfig from dispatchRequest instead of from the builder.
More progress removing things from the Builder struct.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: e59327aaac338bd350746e0e6479489f21a0a1fa
Component: engine
Output `docker swarm join` command on a single line when running `docker swarm init`
Upstream-commit: c22b21fede388f0072a5a01b9177bfafefe269cb
Component: engine