fakeOrderedStore is a fake store that lets tests send AcquireProvisionerJob results in order over a channel, and tests for overlapped calls.
| 563 | // fakeOrderedStore is a fake store that lets tests send AcquireProvisionerJob |
| 564 | // results in order over a channel, and tests for overlapped calls. |
| 565 | type fakeOrderedStore struct { |
| 566 | jobs chan database.ProvisionerJob |
| 567 | errors chan error |
| 568 | |
| 569 | mu sync.Mutex |
| 570 | params []database.AcquireProvisionerJobParams |
| 571 | |
| 572 | // inflight and overlaps track whether any calls from workers overlap with |
| 573 | // one another |
| 574 | inflight map[uuid.UUID]bool |
| 575 | overlaps [][]uuid.UUID |
| 576 | } |
| 577 | |
| 578 | func newFakeOrderedStore() *fakeOrderedStore { |
| 579 | return &fakeOrderedStore{ |
nothing calls this directly
no outgoing calls
no test coverage detected