mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 10:19:50 +00:00
gofmt and add comment about waitForReadyOrDone
This commit is contained in:
parent
27fb17e785
commit
c4479c5b74
@ -91,6 +91,9 @@ func (cm *chaosmonkey) Do() {
|
|||||||
|
|
||||||
By("Waiting for all async tests to be ready")
|
By("Waiting for all async tests to be ready")
|
||||||
for _, sem := range sems {
|
for _, sem := range sems {
|
||||||
|
// Wait for test to be ready. We have to wait for ready *or done* because a test
|
||||||
|
// may panic before signaling that its ready, and we shouldn't block. Since we
|
||||||
|
// defered sem.done() above, if a test panics, it's marked as done.
|
||||||
sem.waitForReadyOrDone()
|
sem.waitForReadyOrDone()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +118,7 @@ type Semaphore struct {
|
|||||||
|
|
||||||
func newSemaphore(stopCh <-chan struct{}) *Semaphore {
|
func newSemaphore(stopCh <-chan struct{}) *Semaphore {
|
||||||
// We don't want to block on Ready() or done()
|
// We don't want to block on Ready() or done()
|
||||||
return &Semaphore {
|
return &Semaphore{
|
||||||
make(chan struct{}, 1),
|
make(chan struct{}, 1),
|
||||||
stopCh,
|
stopCh,
|
||||||
make(chan struct{}, 1),
|
make(chan struct{}, 1),
|
||||||
|
Loading…
Reference in New Issue
Block a user