def test_multi_explicit_fail():
 group = worker.WalTransferGroup(FakeWalUploader())
 segments = list(prepare_multi_upload_segments())
 exp = Explosion('fail')
 segments[0]._upload_explosive = exp
 for seg in segments:
  group.start(seg)
 with pytest.raises(Explosion) as e:
  group.join()
 assert (e.value is exp)
 assert failed(segments[0])
 for seg in segments[1:]:
  assert success(seg)

def test_multi_explicit_fail ( ) : group = worker . WalTransferGroup ( FakeWalUploader ( ) ) segments = list ( prepare_multi_upload_segments ( ) ) exp = Explosion ( 'fail' ) segments [ 0 ] . _upload_explosive = exp for seg in segments : group . start ( seg ) with pytest . raises ( Explosion ) as e : group . join ( ) assert ( e . value is exp ) assert failed ( segments [ 0 ] ) for seg in segments [ 1 : ] : assert success ( seg )
model a failure of the explicit segment under concurrency .