Model a failure of the explicit segment under concurrency.
()
| 135 | |
| 136 | |
| 137 | def test_multi_explicit_fail(): |
| 138 | """Model a failure of the explicit segment under concurrency.""" |
| 139 | group = worker.WalTransferGroup(FakeWalUploader()) |
| 140 | segments = list(prepare_multi_upload_segments()) |
| 141 | |
| 142 | exp = Explosion('fail') |
| 143 | segments[0]._upload_explosive = exp |
| 144 | |
| 145 | for seg in segments: |
| 146 | group.start(seg) |
| 147 | |
| 148 | with pytest.raises(Explosion) as e: |
| 149 | group.join() |
| 150 | |
| 151 | assert e.value is exp |
| 152 | assert failed(segments[0]) |
| 153 | |
| 154 | for seg in segments[1:]: |
| 155 | assert success(seg) |
| 156 | |
| 157 | |
| 158 | def test_multi_pipeline_fail(): |
nothing calls this directly
no test coverage detected