~artmello/ubuntu-push/ubuntu-push-fix_1611848

« back to all changes in this revision

Viewing changes to launch_helper/kindpool.go

  • Committer: CI Train Bot
  • Author(s): Ricardo Salveti de Araujo
  • Date: 2015-04-30 15:08:54 UTC
  • mfrom: (145.1.2 ubuntu-push)
  • Revision ID: ci-train-bot@canonical.com-20150430150854-2u38lu0oi8rtomo1
[ Samuele Pedroni ]
* switch poller to use killswitch state for WLAN instead of misleading NM property (LP: #1446584)
* don't have goroutines from a previous test overlap with the next, races gets detected otherwise
* have the TestDialWorksDirect* tests quickly timeout, go1.3 wants a ServerName set in the tls config for them to work
* fix flaky test
* support sha384/512 certs, some exercizing of that
* let send a build number with acceptanceclient
* add helper to get int out of ConnectMsg Info
Approved by: Samuele Pedroni

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
        chOut      chan *HelperResult
62
62
        chIn       chan *HelperInput
63
63
        chDone     chan *click.AppId
 
64
        chStopped  chan struct{}
64
65
        launchers  map[string]HelperLauncher
65
66
        lock       sync.Mutex
66
67
        hmap       map[string]*HelperArgs
91
92
        pool.chOut = make(chan *HelperResult)
92
93
        pool.chIn = make(chan *HelperInput, InputBufferSize)
93
94
        pool.chDone = make(chan *click.AppId)
 
95
        pool.chStopped = make(chan struct{})
94
96
 
95
97
        for kind, launcher := range pool.launchers {
96
98
                kind1 := kind
115
117
                select {
116
118
                case in, ok := <-pool.chIn:
117
119
                        if !ok {
 
120
                                close(pool.chStopped)
118
121
                                return
119
122
                        }
120
123
                        if len(running) >= pool.maxNum || running[in.App.Original()] {
176
179
                        panic(fmt.Errorf("failed to remove helper observer for &s: %v", kind, err))
177
180
                }
178
181
        }
 
182
        // make Stop sync for tests
 
183
        <-pool.chStopped
179
184
}
180
185
 
181
186
func (pool *kindHelperPool) Run(kind string, input *HelperInput) {