(layerStream io.ReadCloser, decompressor compressiontypes.DecompressorFunc)
| 98 | } |
| 99 | |
| 100 | func goDiffIDComputationGoroutineWithTimeout(layerStream io.ReadCloser, decompressor compressiontypes.DecompressorFunc) *diffIDResult { |
| 101 | ch := make(chan diffIDResult) |
| 102 | go diffIDComputationGoroutine(ch, layerStream, decompressor) |
| 103 | timeout := time.After(time.Second) |
| 104 | select { |
| 105 | case res := <-ch: |
| 106 | return &res |
| 107 | case <-timeout: |
| 108 | return nil |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | func TestDiffIDComputationGoroutine(t *testing.T) { |
| 113 | stream, err := os.Open("fixtures/Hello.uncompressed") |
no test coverage detected
searching dependent graphs…