(t *testing.T)
| 119 | } |
| 120 | |
| 121 | func TestBuildParallel_2(t *testing.T) { |
| 122 | // testfile has 6 builds, 2 of them lock 'forever', other builds |
| 123 | // should go through. |
| 124 | b := NewParallelTestBuilder(4) |
| 125 | locked := &LockedBuilder{unlock: make(chan interface{})} |
| 126 | |
| 127 | c := &BuildCommand{ |
| 128 | Meta: testMetaParallel(t, b, locked), |
| 129 | } |
| 130 | |
| 131 | args := []string{ |
| 132 | "-parallel-builds=3", |
| 133 | filepath.Join(testFixture("parallel"), "2lock-4wg.json"), |
| 134 | } |
| 135 | |
| 136 | wg := errgroup.Group{} |
| 137 | |
| 138 | wg.Go(func() error { |
| 139 | if code := c.Run(args); code != 0 { |
| 140 | fatalCommand(t, c.Meta) |
| 141 | } |
| 142 | return nil |
| 143 | }) |
| 144 | |
| 145 | b.wg.Wait() // ran 4 times |
| 146 | close(locked.unlock) // unlock locking one |
| 147 | wg.Wait() // wait for termination |
| 148 | } |
| 149 | |
| 150 | func TestBuildParallel_Timeout(t *testing.T) { |
| 151 | // testfile has 6 builds, 1 of them locks 'forever', one locks and times |
nothing calls this directly
no test coverage detected
searching dependent graphs…