mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #25341 from tonistiigi/fix-pending-tests
Fix swarm pending state tests
This commit is contained in:
commit
4a94a6513b
1 changed files with 14 additions and 6 deletions
|
@ -807,11 +807,17 @@ func (s *DockerSwarmSuite) TestApiSwarmLeaveOnPendingJoin(c *check.C) {
|
|||
c.Assert(err, checker.IsNil)
|
||||
id = strings.TrimSpace(id)
|
||||
|
||||
go d2.Join(swarm.JoinRequest{
|
||||
RemoteAddrs: []string{"nosuchhost:1234"},
|
||||
err = d2.Join(swarm.JoinRequest{
|
||||
RemoteAddrs: []string{"123.123.123.123:1234"},
|
||||
})
|
||||
c.Assert(err, check.NotNil)
|
||||
c.Assert(err.Error(), checker.Contains, "Timeout was reached")
|
||||
|
||||
waitAndAssert(c, defaultReconciliationTimeout, d2.checkLocalNodeState, checker.Equals, swarm.LocalNodeStateInactive)
|
||||
info, err := d2.info()
|
||||
c.Assert(err, checker.IsNil)
|
||||
c.Assert(info.LocalNodeState, checker.Equals, swarm.LocalNodeStatePending)
|
||||
|
||||
c.Assert(d2.Leave(true), checker.IsNil)
|
||||
|
||||
waitAndAssert(c, defaultReconciliationTimeout, d2.checkActiveContainerCount, checker.Equals, 1)
|
||||
|
||||
|
@ -823,11 +829,13 @@ func (s *DockerSwarmSuite) TestApiSwarmLeaveOnPendingJoin(c *check.C) {
|
|||
// #23705
|
||||
func (s *DockerSwarmSuite) TestApiSwarmRestoreOnPendingJoin(c *check.C) {
|
||||
d := s.AddDaemon(c, false, false)
|
||||
go d.Join(swarm.JoinRequest{
|
||||
RemoteAddrs: []string{"nosuchhost:1234"},
|
||||
err := d.Join(swarm.JoinRequest{
|
||||
RemoteAddrs: []string{"123.123.123.123:1234"},
|
||||
})
|
||||
c.Assert(err, check.NotNil)
|
||||
c.Assert(err.Error(), checker.Contains, "Timeout was reached")
|
||||
|
||||
waitAndAssert(c, defaultReconciliationTimeout, d.checkLocalNodeState, checker.Equals, swarm.LocalNodeStateInactive)
|
||||
waitAndAssert(c, defaultReconciliationTimeout, d.checkLocalNodeState, checker.Equals, swarm.LocalNodeStatePending)
|
||||
|
||||
c.Assert(d.Stop(), checker.IsNil)
|
||||
c.Assert(d.Start(), checker.IsNil)
|
||||
|
|
Loading…
Reference in a new issue