refactor(daemon): binding dispatch is its own type (#1930)
This commit is contained in:
13 files changed
+234
-131
No files matched your search
@@ -108,15 +108,16 @@ func TestBindingDispatchCreatesOneTask(t *testing.T) {
|
||||
store := &ledgerStore{claimed: map[string]bool{}, failures: tc.failures}
|
||||
d := wired(&Daemon{
|
||||
Cfg: config.NewHolder(config.Config{}), Store: store, Log: slog.New(slog.DiscardHandler),
|
||||
Bindings: store, BindingDispatcher: store, BindingTaskCreator: store, Mappings: store,
|
||||
WorkflowDefinitions: orgDefinitions{org.DefaultOrgID: "id: deploy\nrepository: none\nsteps:\n - type: workflow.finish\n"},
|
||||
})
|
||||
d.BindingDispatch.bindings, d.BindingDispatch.dispatcher = store, store
|
||||
d.BindingDispatch.creator, d.BindingDispatch.mappings = store, store
|
||||
for range tc.cycles {
|
||||
var listed, done sync.WaitGroup
|
||||
listed.Add(tc.concurrent)
|
||||
store.listed = &listed
|
||||
for range tc.concurrent {
|
||||
done.Go(func() { d.dispatchBindings(t.Context()) })
|
||||
done.Go(func() { d.BindingDispatch.dispatchBindings(t.Context()) })
|
||||
}
|
||||
done.Wait()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user