(t *testing.T)
| 148 | } |
| 149 | |
| 150 | func TestBuildParallel_Timeout(t *testing.T) { |
| 151 | // testfile has 6 builds, 1 of them locks 'forever', one locks and times |
| 152 | // out other builds should go through. |
| 153 | b := NewParallelTestBuilder(4) |
| 154 | locked := &LockedBuilder{unlock: make(chan interface{})} |
| 155 | |
| 156 | c := &BuildCommand{ |
| 157 | Meta: testMetaParallel(t, b, locked), |
| 158 | } |
| 159 | |
| 160 | args := []string{ |
| 161 | "-parallel-builds=3", |
| 162 | filepath.Join(testFixture("parallel"), "2lock-timeout.json"), |
| 163 | } |
| 164 | |
| 165 | wg := errgroup.Group{} |
| 166 | |
| 167 | wg.Go(func() error { |
| 168 | if code := c.Run(args); code == 0 { |
| 169 | fatalCommand(t, c.Meta) |
| 170 | } |
| 171 | return nil |
| 172 | }) |
| 173 | |
| 174 | b.wg.Wait() // ran 4 times |
| 175 | close(locked.unlock) // unlock locking one |
| 176 | wg.Wait() // wait for termination |
| 177 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…