github.com/jlevesy/mattermost-server@v5.3.2-0.20181003190404-7468f35cb0c8+incompatible/app/cluster_discovery_test.go (about)

     1  // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
     2  // See License.txt for license information.
     3  
     4  package app
     5  
     6  import (
     7  	"testing"
     8  
     9  	"time"
    10  
    11  	"github.com/mattermost/mattermost-server/model"
    12  )
    13  
    14  func TestClusterDiscoveryService(t *testing.T) {
    15  	th := Setup()
    16  	defer th.TearDown()
    17  
    18  	ds := th.App.NewClusterDiscoveryService()
    19  	ds.Type = model.CDS_TYPE_APP
    20  	ds.ClusterName = "ClusterA"
    21  	ds.AutoFillHostname()
    22  
    23  	ds.Start()
    24  	time.Sleep(2 * time.Second)
    25  
    26  	ds.Stop()
    27  	time.Sleep(2 * time.Second)
    28  }