Limit number of concurrent goroutines
This commit is contained in:
parent
5fd9bc851b
commit
62dadc53bf
12 changed files with 206 additions and 103 deletions
|
|
@ -28,12 +28,7 @@ func TestSyncCommand(t *testing.T) {
|
|||
Dest: "awesome-go",
|
||||
}
|
||||
|
||||
ch := make(chan CommandStatus)
|
||||
|
||||
// Pull part
|
||||
go sync.Command(cfg, ch)
|
||||
|
||||
cloneStatus := <-ch
|
||||
cloneStatus := sync.Command(cfg)
|
||||
if cloneStatus.Error {
|
||||
t.Errorf("Unexpected error: %v", cloneStatus.Message)
|
||||
}
|
||||
|
|
@ -54,11 +49,7 @@ func TestSyncCommand(t *testing.T) {
|
|||
t.Errorf("Expected to get %v, instead of this got %v", syncCloned, cloneStatus.Message)
|
||||
}
|
||||
|
||||
// Fetch part
|
||||
go sync.Command(cfg, ch)
|
||||
|
||||
fetchStatus := <-ch
|
||||
|
||||
fetchStatus := sync.Command(cfg)
|
||||
if fetchStatus.Error {
|
||||
t.Errorf("Unexpected error: %v", err.Error())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue