Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
| ... | ... |
@@ -776,11 +776,17 @@ func (s *DockerSwarmSuite) TestApiSwarmLeaveOnPendingJoin(c *check.C) {
|
| 776 | 776 |
c.Assert(err, checker.IsNil) |
| 777 | 777 |
id = strings.TrimSpace(id) |
| 778 | 778 |
|
| 779 |
- go d2.Join(swarm.JoinRequest{
|
|
| 780 |
- RemoteAddrs: []string{"nosuchhost:1234"},
|
|
| 779 |
+ err = d2.Join(swarm.JoinRequest{
|
|
| 780 |
+ RemoteAddrs: []string{"123.123.123.123:1234"},
|
|
| 781 | 781 |
}) |
| 782 |
+ c.Assert(err, check.NotNil) |
|
| 783 |
+ c.Assert(err.Error(), checker.Contains, "Timeout was reached") |
|
| 782 | 784 |
|
| 783 |
- waitAndAssert(c, defaultReconciliationTimeout, d2.checkLocalNodeState, checker.Equals, swarm.LocalNodeStateInactive) |
|
| 785 |
+ info, err := d2.info() |
|
| 786 |
+ c.Assert(err, checker.IsNil) |
|
| 787 |
+ c.Assert(info.LocalNodeState, checker.Equals, swarm.LocalNodeStatePending) |
|
| 788 |
+ |
|
| 789 |
+ c.Assert(d2.Leave(true), checker.IsNil) |
|
| 784 | 790 |
|
| 785 | 791 |
waitAndAssert(c, defaultReconciliationTimeout, d2.checkActiveContainerCount, checker.Equals, 1) |
| 786 | 792 |
|
| ... | ... |
@@ -792,11 +798,13 @@ func (s *DockerSwarmSuite) TestApiSwarmLeaveOnPendingJoin(c *check.C) {
|
| 792 | 792 |
// #23705 |
| 793 | 793 |
func (s *DockerSwarmSuite) TestApiSwarmRestoreOnPendingJoin(c *check.C) {
|
| 794 | 794 |
d := s.AddDaemon(c, false, false) |
| 795 |
- go d.Join(swarm.JoinRequest{
|
|
| 796 |
- RemoteAddrs: []string{"nosuchhost:1234"},
|
|
| 795 |
+ err := d.Join(swarm.JoinRequest{
|
|
| 796 |
+ RemoteAddrs: []string{"123.123.123.123:1234"},
|
|
| 797 | 797 |
}) |
| 798 |
+ c.Assert(err, check.NotNil) |
|
| 799 |
+ c.Assert(err.Error(), checker.Contains, "Timeout was reached") |
|
| 798 | 800 |
|
| 799 |
- waitAndAssert(c, defaultReconciliationTimeout, d.checkLocalNodeState, checker.Equals, swarm.LocalNodeStateInactive) |
|
| 801 |
+ waitAndAssert(c, defaultReconciliationTimeout, d.checkLocalNodeState, checker.Equals, swarm.LocalNodeStatePending) |
|
| 800 | 802 |
|
| 801 | 803 |
c.Assert(d.Stop(), checker.IsNil) |
| 802 | 804 |
c.Assert(d.Start(), checker.IsNil) |