CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
edmtest::ExceptionThrowingProducer Class Reference
Inheritance diagram for edmtest::ExceptionThrowingProducer:
edm::global::EDProducer< edm::StreamCache< Cache >, edm::RunCache< Cache >, edm::LuminosityBlockCache< Cache >, edm::WatchProcessBlock > edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob () override
 
void beginProcessBlock (edm::ProcessBlock const &processBlock) override
 
std::unique_ptr< Cache > beginStream (edm::StreamID) const override
 
void endJob () override
 
void endProcessBlock (edm::ProcessBlock const &processBlock) override
 
void endStream (edm::StreamID) const override
 
 ExceptionThrowingProducer (edm::ParameterSet const &)
 
 ExceptionThrowingProducer (const ExceptionThrowingProducer &)=delete
 
 ExceptionThrowingProducer (ExceptionThrowingProducer &&)=delete
 
std::shared_ptr< Cache > globalBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
std::shared_ptr< Cache > globalBeginRun (edm::Run const &, edm::EventSetup const &) const override
 
void globalEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void globalEndRun (edm::Run const &, edm::EventSetup const &) const override
 
ExceptionThrowingProduceroperator= (const ExceptionThrowingProducer &)=delete
 
ExceptionThrowingProduceroperator= (ExceptionThrowingProducer &&)=delete
 
void produce (edm::StreamID, edm::Event &, edm::EventSetup const &) const override
 
void streamBeginLuminosityBlock (edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void streamBeginRun (edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
 
void streamEndLuminosityBlock (edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
 
void streamEndRun (edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
 
 ~ExceptionThrowingProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::global::EDProducer< edm::StreamCache< Cache >, edm::RunCache< Cache >, edm::LuminosityBlockCache< Cache >, edm::WatchProcessBlock >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::EventID eventIDThrowOnEvent_
 
const edm::EventID eventIDThrowOnGlobalBeginLumi_
 
const edm::EventID eventIDThrowOnGlobalBeginRun_
 
const edm::EventID eventIDThrowOnGlobalEndLumi_
 
const edm::EventID eventIDThrowOnGlobalEndRun_
 
const edm::EventID eventIDThrowOnStreamBeginLumi_
 
const edm::EventID eventIDThrowOnStreamBeginRun_
 
const edm::EventID eventIDThrowOnStreamEndLumi_
 
const edm::EventID eventIDThrowOnStreamEndRun_
 
const unsigned int expectedGlobalBeginLumi_
 
const unsigned int expectedGlobalBeginRun_
 
const unsigned int expectedNBeginJob_
 
const unsigned int expectedNBeginProcessBlock_
 
const unsigned int expectedNBeginStream_
 
const unsigned int expectedNEndJob_
 
const unsigned int expectedNEndProcessBlock_
 
const unsigned int expectedNEndStream_
 
const unsigned int expectedOffsetNoEndJob_
 
const unsigned int expectedOffsetNoEndProcessBlock_
 
const unsigned int expectedOffsetNoEndStream_
 
const unsigned int expectedOffsetNoGlobalEndLumi_
 
const unsigned int expectedOffsetNoGlobalEndRun_
 
const unsigned int expectedOffsetNoStreamEndLumi_
 
const unsigned int expectedOffsetNoStreamEndRun_
 
const unsigned int expectedOffsetNoWriteLumi_
 
const unsigned int expectedOffsetNoWriteRun_
 
const unsigned int expectedStreamBeginLumi_
 
const unsigned int expectedStreamBeginRun_
 
const bool expectNoRunsProcessed_
 
std::atomic< bool > globalBeginLumiExceptionOccurred_ = false
 
std::atomic< bool > globalBeginRunExceptionOccurred_ = false
 
unsigned int nBeginJob_ = 0
 
unsigned int nBeginProcessBlock_ = 0
 
std::atomic< unsigned int > nBeginStream_ {0}
 
unsigned int nEndJob_ = 0
 
unsigned int nEndProcessBlock_ = 0
 
std::atomic< unsigned int > nEndStream_ {0}
 
std::atomic< unsigned int > nGlobalBeginLumi_ {0}
 
std::atomic< unsigned int > nGlobalBeginRun_ {0}
 
std::atomic< unsigned int > nGlobalEndLumi_ {0}
 
std::atomic< unsigned int > nGlobalEndRun_ {0}
 
std::vector< unsigned int > nStreamBeginLumi_
 
std::vector< unsigned int > nStreamBeginRun_
 
std::vector< unsigned int > nStreamEndLumi_
 
std::vector< unsigned int > nStreamEndRun_
 
std::atomic< bool > streamBeginLumiExceptionOccurred_ = false
 
std::atomic< bool > streamBeginRunExceptionOccurred_ = false
 
std::atomic< bool > streamEndLumiExceptionOccurred_ = false
 
std::atomic< bool > streamEndRunExceptionOccurred_ = false
 
unsigned int streamWithBeginLumiException_ = kUnset
 
unsigned int streamWithBeginRunException_ = kUnset
 
const bool throwInBeginJob_
 
const bool throwInBeginProcessBlock_
 
const bool throwInBeginStream_
 
const bool throwInEndJob_
 
const bool throwInEndProcessBlock_
 
const bool throwInEndStream_
 
const bool verbose_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 49 of file ExceptionThrowingProducer.cc.

Constructor & Destructor Documentation

◆ ExceptionThrowingProducer() [1/3]

edmtest::ExceptionThrowingProducer::ExceptionThrowingProducer ( edm::ParameterSet const &  pset)
explicit

Definition at line 156 of file ExceptionThrowingProducer.cc.

157  : verbose_(pset.getUntrackedParameter<bool>("verbose")),
158  eventIDThrowOnEvent_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnEvent")),
159  eventIDThrowOnGlobalBeginRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalBeginRun")),
160  eventIDThrowOnGlobalBeginLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalBeginLumi")),
161  eventIDThrowOnGlobalEndRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalEndRun")),
162  eventIDThrowOnGlobalEndLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnGlobalEndLumi")),
163  eventIDThrowOnStreamBeginRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamBeginRun")),
164  eventIDThrowOnStreamBeginLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamBeginLumi")),
165  eventIDThrowOnStreamEndRun_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamEndRun")),
166  eventIDThrowOnStreamEndLumi_(pset.getUntrackedParameter<edm::EventID>("eventIDThrowOnStreamEndLumi")),
167  throwInBeginJob_(pset.getUntrackedParameter<bool>("throwInBeginJob")),
168  throwInBeginStream_(pset.getUntrackedParameter<bool>("throwInBeginStream")),
169  throwInBeginProcessBlock_(pset.getUntrackedParameter<bool>("throwInBeginProcessBlock")),
170  throwInEndProcessBlock_(pset.getUntrackedParameter<bool>("throwInEndProcessBlock")),
171  throwInEndStream_(pset.getUntrackedParameter<bool>("throwInEndStream")),
172  throwInEndJob_(pset.getUntrackedParameter<bool>("throwInEndJob")),
177  expectedNBeginJob_(pset.getUntrackedParameter<unsigned int>("expectedNBeginJob")),
178  expectedNBeginStream_(pset.getUntrackedParameter<unsigned int>("expectedNBeginStream")),
179  expectedNBeginProcessBlock_(pset.getUntrackedParameter<unsigned int>("expectedNBeginProcessBlock")),
180  expectedNEndProcessBlock_(pset.getUntrackedParameter<unsigned int>("expectedNEndProcessBlock")),
181  expectedNEndStream_(pset.getUntrackedParameter<unsigned int>("expectedNEndStream")),
182  expectedNEndJob_(pset.getUntrackedParameter<unsigned int>("expectedNEndJob")),
183  expectNoRunsProcessed_(pset.getUntrackedParameter<bool>("expectNoRunsProcessed")),
184  expectedOffsetNoEndJob_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoEndJob")),
185  expectedOffsetNoEndStream_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoEndStream")),
186  expectedOffsetNoEndProcessBlock_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoEndProcessBlock")),
187  expectedStreamBeginLumi_(pset.getUntrackedParameter<unsigned int>("expectedStreamBeginLumi")),
188  expectedOffsetNoStreamEndLumi_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoStreamEndLumi")),
189  expectedGlobalBeginLumi_(pset.getUntrackedParameter<unsigned int>("expectedGlobalBeginLumi")),
190  expectedOffsetNoGlobalEndLumi_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoGlobalEndLumi")),
191  expectedOffsetNoWriteLumi_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoWriteLumi")),
192  expectedStreamBeginRun_(pset.getUntrackedParameter<unsigned int>("expectedStreamBeginRun")),
193  expectedOffsetNoStreamEndRun_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoStreamEndRun")),
194  expectedGlobalBeginRun_(pset.getUntrackedParameter<unsigned int>("expectedGlobalBeginRun")),
195  expectedOffsetNoGlobalEndRun_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoGlobalEndRun")),
196  expectedOffsetNoWriteRun_(pset.getUntrackedParameter<unsigned int>("expectedOffsetNoWriteRun")) {}
std::vector< unsigned int > nStreamBeginRun_
constexpr unsigned int kTestStreams
std::vector< unsigned int > nStreamBeginLumi_

◆ ~ExceptionThrowingProducer()

edmtest::ExceptionThrowingProducer::~ExceptionThrowingProducer ( )
overridenoexcept

Definition at line 198 of file ExceptionThrowingProducer.cc.

References expectedNBeginJob_, expectedNEndJob_, expectedOffsetNoEndJob_, kNumberOfModulesWithJobTransitions, nBeginJob_, nBeginProcessBlock_, nBeginStream_, nEndJob_, nEndProcessBlock_, nEndStream_, nGlobalBeginRun_, nGlobalEndRun_, edmtest::TestServiceOne::nPostEndJob(), edmtest::TestServiceOne::nPostModuleEndJob(), edmtest::TestServiceOne::nPreModuleEndJob(), and verbose_.

198  {
200  edm::LogAbsolute("ExceptionThrowingProducer")
201  << "ExceptionThrowingProducer::beginJob did not run expected number of times.";
202  edm::LogAbsolute("ExceptionThrowingProducer") << "At least one test in ExceptionThrowingProducer FAILED";
203  } else if (nEndJob_ != expectedNEndJob_) {
204  edm::LogAbsolute("ExceptionThrowingProducer")
205  << "ExceptionThrowingProducer::endJob did not run expected number of times.";
206  edm::LogAbsolute("ExceptionThrowingProducer") << "At least one test in ExceptionThrowingProducer FAILED";
207  } else if (nEndJob_ == 0u && nBeginProcessBlock_ == 0 && nEndProcessBlock_ == 0 && nBeginStream_.load() == 0 &&
208  nEndStream_.load() == 0 && nGlobalBeginRun_.load() == 0 && nGlobalEndRun_.load() == 0) {
209  edm::LogAbsolute("ExceptionThrowingProducer") << "All tests in ExceptionThrowingProducer PASSED";
210  }
211 
213 
214  if (verbose_) {
215  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPostEndJob = " << serviceOne->nPostEndJob();
216  edm::LogAbsolute("ExceptionThrowingProducer")
217  << "serviceOne->nPreModuleEndJob = " << serviceOne->nPreModuleEndJob();
218  edm::LogAbsolute("ExceptionThrowingProducer")
219  << "serviceOne->nPostModuleEndJob = " << serviceOne->nPostModuleEndJob();
220  }
221 
222  if (serviceOne->nPostEndJob() != nBeginJob_ ||
225  edm::LogAbsolute("ExceptionThrowingProducer")
226  << "FAILED: Unexpected number of service end job related signals in TestServiceOne, checking while in "
227  "ExceptionThrowingProducer destructor";
228  edm::LogAbsolute("ExceptionThrowingProducer") << "At least one test in ExceptionThrowingProducer FAILED";
229  }
230  }
unsigned int nPreModuleEndJob() const
constexpr unsigned int kNumberOfModulesWithJobTransitions
unsigned int nPostModuleEndJob() const
Log< level::System, true > LogAbsolute
unsigned int nPostEndJob() const
std::atomic< unsigned int > nGlobalBeginRun_

◆ ExceptionThrowingProducer() [2/3]

edmtest::ExceptionThrowingProducer::ExceptionThrowingProducer ( const ExceptionThrowingProducer )
delete

◆ ExceptionThrowingProducer() [3/3]

edmtest::ExceptionThrowingProducer::ExceptionThrowingProducer ( ExceptionThrowingProducer &&  )
delete

Member Function Documentation

◆ beginJob()

void edmtest::ExceptionThrowingProducer::beginJob ( void  )
overridevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 393 of file ExceptionThrowingProducer.cc.

References Exception, nBeginJob_, and throwInBeginJob_.

393  {
394  ++nBeginJob_;
395  if (throwInBeginJob_) {
396  throw cms::Exception("IntentionalTestException")
397  << "ExceptionThrowingProducer::beginJob, module configured to throw during beginJob";
398  }
399  }

◆ beginProcessBlock()

void edmtest::ExceptionThrowingProducer::beginProcessBlock ( edm::ProcessBlock const &  processBlock)
override

Definition at line 377 of file ExceptionThrowingProducer.cc.

References Exception, nBeginProcessBlock_, and throwInBeginProcessBlock_.

377  {
380  throw cms::Exception("IntentionalTestException")
381  << "ExceptionThrowingProducer::beginProcessBlock, module configured to throw during beginProcessBlock";
382  }
383  }

◆ beginStream()

std::unique_ptr< Cache > edmtest::ExceptionThrowingProducer::beginStream ( edm::StreamID  streamID) const
override

Definition at line 284 of file ExceptionThrowingProducer.cc.

References Exception, kStreamToThrowOn, nBeginStream_, throwInBeginStream_, and edm::StreamID::value().

284  {
285  ++nBeginStream_;
286  if (throwInBeginStream_ && streamID.value() == kStreamToThrowOn) {
287  throw cms::Exception("IntentionalTestException")
288  << "ExceptionThrowingProducer::beginStream, module configured to throw during beginStream for stream: "
289  << kStreamToThrowOn;
290  }
291  return std::make_unique<Cache>();
292  }
constexpr unsigned int kStreamToThrowOn
unsigned int value() const
Definition: StreamID.h:43

◆ endJob()

void edmtest::ExceptionThrowingProducer::endJob ( void  )
overridevirtual

Reimplemented from edm::global::EDProducerBase.

Definition at line 401 of file ExceptionThrowingProducer.cc.

References Exception, expectedGlobalBeginLumi_, expectedGlobalBeginRun_, expectedNBeginProcessBlock_, expectedNBeginStream_, expectedNEndProcessBlock_, expectedNEndStream_, expectedOffsetNoEndProcessBlock_, expectedOffsetNoEndStream_, expectedOffsetNoGlobalEndLumi_, expectedOffsetNoGlobalEndRun_, expectedOffsetNoStreamEndLumi_, expectedOffsetNoStreamEndRun_, expectedOffsetNoWriteLumi_, expectedOffsetNoWriteRun_, expectedStreamBeginLumi_, expectedStreamBeginRun_, expectNoRunsProcessed_, globalBeginLumiExceptionOccurred_, globalBeginRunExceptionOccurred_, mps_fire::i, kNumberOfModulesWithJobTransitions, kNumberOfModulesWithProcessBlockTransitions, kNumberOfModulesWithStreamTransitions, kNumberOfTestModules, kUnset, nBeginJob_, nBeginProcessBlock_, nBeginStream_, nEndJob_, nEndProcessBlock_, nEndStream_, nGlobalBeginLumi_, nGlobalBeginRun_, nGlobalEndLumi_, nGlobalEndRun_, edmtest::TestServiceOne::nPostBeginJob(), edmtest::TestServiceOne::nPostBeginProcessBlock(), edmtest::TestServiceOne::nPostBeginStream(), edmtest::TestServiceOne::nPostEndProcessBlock(), edmtest::TestServiceOne::nPostEndStream(), edmtest::TestServiceTwo::nPostGlobalBeginLumi(), edmtest::TestServiceOne::nPostGlobalBeginLumi(), edmtest::TestServiceTwo::nPostGlobalBeginRun(), edmtest::TestServiceOne::nPostGlobalBeginRun(), edmtest::TestServiceTwo::nPostGlobalEndLumi(), edmtest::TestServiceOne::nPostGlobalEndLumi(), edmtest::TestServiceTwo::nPostGlobalEndRun(), edmtest::TestServiceOne::nPostGlobalEndRun(), edmtest::TestServiceTwo::nPostGlobalWriteLumi(), edmtest::TestServiceOne::nPostGlobalWriteLumi(), edmtest::TestServiceTwo::nPostGlobalWriteRun(), edmtest::TestServiceOne::nPostGlobalWriteRun(), edmtest::TestServiceOne::nPostModuleBeginJob(), edmtest::TestServiceOne::nPostModuleBeginProcessBlock(), edmtest::TestServiceOne::nPostModuleBeginStream(), edmtest::TestServiceOne::nPostModuleEndProcessBlock(), edmtest::TestServiceOne::nPostModuleEndStream(), edmtest::TestServiceTwo::nPostModuleGlobalBeginLumi(), edmtest::TestServiceOne::nPostModuleGlobalBeginLumi(), edmtest::TestServiceTwo::nPostModuleGlobalBeginRun(), edmtest::TestServiceOne::nPostModuleGlobalBeginRun(), edmtest::TestServiceTwo::nPostModuleGlobalEndLumi(), edmtest::TestServiceOne::nPostModuleGlobalEndLumi(), edmtest::TestServiceTwo::nPostModuleGlobalEndRun(), edmtest::TestServiceOne::nPostModuleGlobalEndRun(), edmtest::TestServiceTwo::nPostModuleStreamBeginLumi(), edmtest::TestServiceOne::nPostModuleStreamBeginLumi(), edmtest::TestServiceTwo::nPostModuleStreamBeginRun(), edmtest::TestServiceOne::nPostModuleStreamBeginRun(), edmtest::TestServiceTwo::nPostModuleStreamEndLumi(), edmtest::TestServiceOne::nPostModuleStreamEndLumi(), edmtest::TestServiceTwo::nPostModuleStreamEndRun(), edmtest::TestServiceOne::nPostModuleStreamEndRun(), edmtest::TestServiceTwo::nPostStreamBeginLumi(), edmtest::TestServiceOne::nPostStreamBeginLumi(), edmtest::TestServiceTwo::nPostStreamBeginRun(), edmtest::TestServiceOne::nPostStreamBeginRun(), edmtest::TestServiceTwo::nPostStreamEndLumi(), edmtest::TestServiceOne::nPostStreamEndLumi(), edmtest::TestServiceTwo::nPostStreamEndRun(), edmtest::TestServiceOne::nPostStreamEndRun(), edmtest::TestServiceOne::nPreBeginJob(), edmtest::TestServiceOne::nPreBeginProcessBlock(), edmtest::TestServiceOne::nPreBeginStream(), edmtest::TestServiceOne::nPreEndJob(), edmtest::TestServiceOne::nPreEndProcessBlock(), edmtest::TestServiceOne::nPreEndStream(), edmtest::TestServiceTwo::nPreGlobalBeginLumi(), edmtest::TestServiceOne::nPreGlobalBeginLumi(), edmtest::TestServiceTwo::nPreGlobalBeginRun(), edmtest::TestServiceOne::nPreGlobalBeginRun(), edmtest::TestServiceTwo::nPreGlobalEndLumi(), edmtest::TestServiceOne::nPreGlobalEndLumi(), edmtest::TestServiceTwo::nPreGlobalEndRun(), edmtest::TestServiceOne::nPreGlobalEndRun(), edmtest::TestServiceTwo::nPreGlobalWriteLumi(), edmtest::TestServiceOne::nPreGlobalWriteLumi(), edmtest::TestServiceTwo::nPreGlobalWriteRun(), edmtest::TestServiceOne::nPreGlobalWriteRun(), edmtest::TestServiceOne::nPreModuleBeginJob(), edmtest::TestServiceOne::nPreModuleBeginProcessBlock(), edmtest::TestServiceOne::nPreModuleBeginStream(), edmtest::TestServiceOne::nPreModuleEndProcessBlock(), edmtest::TestServiceOne::nPreModuleEndStream(), edmtest::TestServiceTwo::nPreModuleGlobalBeginLumi(), edmtest::TestServiceOne::nPreModuleGlobalBeginLumi(), edmtest::TestServiceTwo::nPreModuleGlobalBeginRun(), edmtest::TestServiceOne::nPreModuleGlobalBeginRun(), edmtest::TestServiceTwo::nPreModuleGlobalEndLumi(), edmtest::TestServiceOne::nPreModuleGlobalEndLumi(), edmtest::TestServiceTwo::nPreModuleGlobalEndRun(), edmtest::TestServiceOne::nPreModuleGlobalEndRun(), edmtest::TestServiceTwo::nPreModuleStreamBeginLumi(), edmtest::TestServiceOne::nPreModuleStreamBeginLumi(), edmtest::TestServiceTwo::nPreModuleStreamBeginRun(), edmtest::TestServiceOne::nPreModuleStreamBeginRun(), edmtest::TestServiceTwo::nPreModuleStreamEndLumi(), edmtest::TestServiceOne::nPreModuleStreamEndLumi(), edmtest::TestServiceTwo::nPreModuleStreamEndRun(), edmtest::TestServiceOne::nPreModuleStreamEndRun(), edmtest::TestServiceTwo::nPreStreamBeginLumi(), edmtest::TestServiceOne::nPreStreamBeginLumi(), edmtest::TestServiceTwo::nPreStreamBeginRun(), edmtest::TestServiceOne::nPreStreamBeginRun(), edmtest::TestServiceTwo::nPreStreamEndLumi(), edmtest::TestServiceOne::nPreStreamEndLumi(), edmtest::TestServiceTwo::nPreStreamEndRun(), edmtest::TestServiceOne::nPreStreamEndRun(), nStreamBeginLumi_, nStreamBeginRun_, nStreamEndLumi_, nStreamEndRun_, streamWithBeginLumiException_, streamWithBeginRunException_, throwInEndJob_, and verbose_.

401  {
402  ++nEndJob_;
403 
404  bool testsPass = true;
405 
406  if (nBeginStream_.load() != expectedNBeginStream_) {
407  edm::LogAbsolute("ExceptionThrowingProducer")
408  << "FAILED: Unexpected number of beginStream transitions, saw: " << nBeginStream_.load()
409  << " expected: " << expectedNBeginStream_;
410  testsPass = false;
411  }
412 
414  edm::LogAbsolute("ExceptionThrowingProducer")
415  << "FAILED: Unexpected number of beginProcessBlock transitions, saw: " << nBeginProcessBlock_
416  << " expected: " << expectedNBeginProcessBlock_;
417  testsPass = false;
418  }
419 
421  edm::LogAbsolute("ExceptionThrowingProducer")
422  << "FAILED: Unexpected number of endProcessBlock transitions, saw: " << nEndProcessBlock_
423  << " expected: " << expectedNEndProcessBlock_;
424  testsPass = false;
425  }
426 
427  if (nEndStream_.load() != expectedNEndStream_) {
428  edm::LogAbsolute("ExceptionThrowingProducer")
429  << "FAILED: Unexpected number of endStream transitions, saw: " << nEndStream_.load()
430  << " expected: " << expectedNEndStream_;
431  testsPass = false;
432  }
433 
434  if (expectNoRunsProcessed_ && nGlobalBeginRun_.load() != 0) {
435  edm::LogAbsolute("ExceptionThrowingProducer")
436  << "FAILED: Unexpected number of globalBeginRun transitions, saw: " << nGlobalBeginRun_.load()
437  << " expected: " << 0;
438  testsPass = false;
439  }
440 
441  unsigned int totalStreamBeginLumi = 0;
442  unsigned int i = 0;
443  for (auto const& nStreamBeginLumi : nStreamBeginLumi_) {
444  totalStreamBeginLumi += nStreamBeginLumi;
445 
446  // Don't know exact number to expect because streams might skip a lumi so
447  // only throw if it is greater than the maximum possible and we only know
448  // that for sure if the exception was thrown in stream begin lumi.
449  if (nStreamBeginLumi > expectedStreamBeginLumi_ && streamWithBeginLumiException_ != kUnset) {
450  edm::LogAbsolute("ExceptionThrowingProducer")
451  << "FAILED: More than maximum possible number of streamBeginLumi transitions, stream " << i << " saw "
452  << nStreamBeginLumi << " max possible " << expectedStreamBeginLumi_;
453  testsPass = false;
454  }
455  unsigned int expectedStreamEndLumi =
456  (streamWithBeginLumiException_ == i) ? nStreamBeginLumi - 1 : nStreamBeginLumi;
457  if (nStreamEndLumi_[i] != expectedStreamEndLumi) {
458  edm::LogAbsolute("ExceptionThrowingProducer")
459  << "FAILED: Unexpected number of streamEndLumi transitions, stream " << i << " saw " << nStreamEndLumi_[i]
460  << " expected " << expectedStreamEndLumi;
461  testsPass = false;
462  }
463 
464  ++i;
465  }
466 
467  unsigned int totalStreamBeginRun = 0;
468  i = 0;
469  for (auto const& nStreamBeginRun : nStreamBeginRun_) {
470  totalStreamBeginRun += nStreamBeginRun;
471 
472  // Don't know exact number to expect because streams might skip a run (not yet
473  // but probably in the future) so only throw if it is greater than the maximum
474  // possible and we only know that for sure if the exception was thrown in stream begin run.
475  if (nStreamBeginRun > expectedStreamBeginRun_ && streamWithBeginRunException_ != kUnset) {
476  edm::LogAbsolute("ExceptionThrowingProducer")
477  << "FAILED: More than maximum possible number of streamBeginRun transitions, stream " << i << " saw "
478  << nStreamBeginRun << " max possible " << expectedStreamBeginRun_;
479  testsPass = false;
480  }
481  unsigned int expectedStreamEndRun = (streamWithBeginRunException_ == i) ? nStreamBeginRun - 1 : nStreamBeginRun;
482  if (nStreamEndRun_[i] != expectedStreamEndRun) {
483  edm::LogAbsolute("ExceptionThrowingProducer")
484  << "FAILED: Unexpected number of streamEndRun transitions, stream " << i << " saw " << nStreamEndRun_[i]
485  << " expected " << expectedStreamEndRun;
486  testsPass = false;
487  }
488 
489  ++i;
490  }
491 
492  // There has to be at least as many global begin lumi transitions
493  // as expected. Because of concurrency, the Framework might already have
494  // started other lumis ahead of the one where an exception occurs.
496  edm::LogAbsolute("ExceptionThrowingProducer")
497  << "FAILED: Less than the expected number of globalBeginLumi transitions, expected at least "
498  << expectedGlobalBeginLumi_ << " saw " << nGlobalBeginLumi_.load();
499  testsPass = false;
500  }
501 
502  // There has to be at least as many global begin run transitions
503  // as expected. Because of concurrency, the Framework might already have
504  // started other runs ahead of the one where an exception occurs.
506  edm::LogAbsolute("ExceptionThrowingProducer")
507  << "FAILED: Less than the expected number of globalBeginRun transitions, expected at least "
508  << expectedGlobalBeginRun_ << " saw " << nGlobalBeginRun_.load();
509  testsPass = false;
510  }
511 
512  unsigned int expectedGlobalEndLumi =
514  if (nGlobalEndLumi_.load() != expectedGlobalEndLumi) {
515  edm::LogAbsolute("ExceptionThrowingProducer")
516  << "FAILED: number of global end lumi transitions not equal to expected value, expected "
517  << expectedGlobalEndLumi << " saw " << nGlobalEndLumi_.load();
518  testsPass = false;
519  }
520 
521  unsigned int expectedGlobalEndRun =
523  if (nGlobalEndRun_.load() != expectedGlobalEndRun) {
524  edm::LogAbsolute("ExceptionThrowingProducer")
525  << "FAILED: number of global end run transitions not equal to expected value, expected "
526  << expectedGlobalEndRun << " saw " << nGlobalEndRun_.load();
527  testsPass = false;
528  }
529 
531  if (serviceOne->nPreBeginJob() != nBeginJob_ || serviceOne->nPostBeginJob() != nBeginJob_ ||
532  serviceOne->nPreEndJob() != nBeginJob_ ||
535  edm::LogAbsolute("ExceptionThrowingProducer")
536  << "FAILED: Unexpected number of service transitions in TestServiceOne, beginJob and endJob";
537  testsPass = false;
538  }
539 
540  if (serviceOne->nPreBeginStream() != nBeginStream_ || serviceOne->nPostBeginStream() != nBeginStream_ ||
541  serviceOne->nPreEndStream() != nBeginStream_ || serviceOne->nPostEndStream() != nBeginStream_ ||
544  serviceOne->nPreModuleEndStream() !=
546  serviceOne->nPostModuleEndStream() !=
548  edm::LogAbsolute("ExceptionThrowingProducer")
549  << "FAILED: Unexpected number of service transitions in TestServiceOne, beginStream and endStream";
550  testsPass = false;
551  }
552 
553  if (serviceOne->nPreBeginProcessBlock() != nBeginProcessBlock_ ||
554  serviceOne->nPostBeginProcessBlock() != nBeginProcessBlock_ ||
555  serviceOne->nPreEndProcessBlock() != nBeginProcessBlock_ ||
556  serviceOne->nPostEndProcessBlock() != nBeginProcessBlock_ ||
557  serviceOne->nPreModuleBeginProcessBlock() !=
559  serviceOne->nPostModuleBeginProcessBlock() !=
561  serviceOne->nPreModuleEndProcessBlock() !=
563  serviceOne->nPostModuleEndProcessBlock() !=
565  edm::LogAbsolute("ExceptionThrowingProducer") << "FAILED: Unexpected number of service transitions in "
566  "TestServiceOne, beginProcessBlock and endProcessBlock";
567  testsPass = false;
568  }
569 
570  if (serviceOne->nPreStreamBeginLumi() != totalStreamBeginLumi ||
571  serviceOne->nPostStreamBeginLumi() != totalStreamBeginLumi ||
572  serviceOne->nPreStreamEndLumi() != totalStreamBeginLumi ||
573  serviceOne->nPostStreamEndLumi() != totalStreamBeginLumi ||
574  serviceOne->nPreModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
575  serviceOne->nPostModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
576  serviceOne->nPreModuleStreamEndLumi() !=
577  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_ ||
578  serviceOne->nPostModuleStreamEndLumi() !=
579  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_) {
580  edm::LogAbsolute("ExceptionThrowingProducer")
581  << "FAILED: Unexpected number of service transitions in TestServiceOne, stream lumi";
582  testsPass = false;
583  }
584 
586  if (serviceTwo->nPreStreamBeginLumi() != totalStreamBeginLumi ||
587  serviceTwo->nPostStreamBeginLumi() != totalStreamBeginLumi ||
588  serviceTwo->nPreStreamEndLumi() != totalStreamBeginLumi ||
589  serviceTwo->nPostStreamEndLumi() != totalStreamBeginLumi ||
590  serviceTwo->nPreModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
591  serviceTwo->nPostModuleStreamBeginLumi() != totalStreamBeginLumi * kNumberOfTestModules ||
592  serviceTwo->nPreModuleStreamEndLumi() !=
593  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_ ||
594  serviceTwo->nPostModuleStreamEndLumi() !=
595  totalStreamBeginLumi * kNumberOfTestModules - expectedOffsetNoStreamEndLumi_) {
596  edm::LogAbsolute("ExceptionThrowingProducer")
597  << "FAILED: Unexpected number of service transitions in TestServiceTwo, stream lumi";
598  testsPass = false;
599  }
600 
601  unsigned int nGlobalBeginLumi = nGlobalBeginLumi_.load();
602 
603  if (serviceOne->nPreGlobalBeginLumi() != nGlobalBeginLumi ||
604  serviceOne->nPostGlobalBeginLumi() != nGlobalBeginLumi || serviceOne->nPreGlobalEndLumi() != nGlobalBeginLumi ||
605  serviceOne->nPostGlobalEndLumi() != nGlobalBeginLumi ||
606  serviceOne->nPreModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
607  serviceOne->nPostModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
608  serviceOne->nPreModuleGlobalEndLumi() !=
610  serviceOne->nPostModuleGlobalEndLumi() !=
612  serviceOne->nPreGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_ ||
613  serviceOne->nPostGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_) {
614  edm::LogAbsolute("ExceptionThrowingProducer")
615  << "FAILED: Unexpected number of service transitions in TestServiceOne, global lumi";
616  testsPass = false;
617  }
618 
619  if (serviceTwo->nPreGlobalBeginLumi() != nGlobalBeginLumi ||
620  serviceTwo->nPostGlobalBeginLumi() != nGlobalBeginLumi || serviceTwo->nPreGlobalEndLumi() != nGlobalBeginLumi ||
621  serviceTwo->nPostGlobalEndLumi() != nGlobalBeginLumi ||
622  serviceTwo->nPreModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
623  serviceTwo->nPostModuleGlobalBeginLumi() != nGlobalBeginLumi * kNumberOfTestModules ||
624  serviceTwo->nPreModuleGlobalEndLumi() !=
626  serviceTwo->nPostModuleGlobalEndLumi() !=
628  serviceTwo->nPreGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_ ||
629  serviceTwo->nPostGlobalWriteLumi() != nGlobalBeginLumi - expectedOffsetNoWriteLumi_) {
630  edm::LogAbsolute("ExceptionThrowingProducer")
631  << "FAILED: Unexpected number of service transitions in TestServiceTwo, global lumi";
632  testsPass = false;
633  }
634 
635  if (serviceOne->nPreStreamBeginRun() != totalStreamBeginRun ||
636  serviceOne->nPostStreamBeginRun() != totalStreamBeginRun ||
637  serviceOne->nPreStreamEndRun() != totalStreamBeginRun ||
638  serviceOne->nPostStreamEndRun() != totalStreamBeginRun ||
639  serviceOne->nPreModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
640  serviceOne->nPostModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
641  serviceOne->nPreModuleStreamEndRun() !=
642  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_ ||
643  serviceOne->nPostModuleStreamEndRun() !=
644  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_) {
645  edm::LogAbsolute("ExceptionThrowingProducer")
646  << "FAILED: Unexpected number of service transitions in TestServiceOne, stream run";
647  testsPass = false;
648  }
649 
650  if (serviceTwo->nPreStreamBeginRun() != totalStreamBeginRun ||
651  serviceTwo->nPostStreamBeginRun() != totalStreamBeginRun ||
652  serviceTwo->nPreStreamEndRun() != totalStreamBeginRun ||
653  serviceTwo->nPostStreamEndRun() != totalStreamBeginRun ||
654  serviceTwo->nPreModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
655  serviceTwo->nPostModuleStreamBeginRun() != totalStreamBeginRun * kNumberOfTestModules ||
656  serviceTwo->nPreModuleStreamEndRun() !=
657  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_ ||
658  serviceTwo->nPostModuleStreamEndRun() !=
659  totalStreamBeginRun * kNumberOfTestModules - expectedOffsetNoStreamEndRun_) {
660  edm::LogAbsolute("ExceptionThrowingProducer")
661  << "FAILED: Unexpected number of service transitions in TestServiceTwo, stream run";
662  testsPass = false;
663  }
664 
665  unsigned int nGlobalBeginRun = nGlobalBeginRun_.load();
666 
667  if (serviceOne->nPreGlobalBeginRun() != nGlobalBeginRun || serviceOne->nPostGlobalBeginRun() != nGlobalBeginRun ||
668  serviceOne->nPreGlobalEndRun() != nGlobalBeginRun || serviceOne->nPostGlobalEndRun() != nGlobalBeginRun ||
669  serviceOne->nPreModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
670  serviceOne->nPostModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
671  serviceOne->nPreModuleGlobalEndRun() !=
673  serviceOne->nPostModuleGlobalEndRun() !=
675  serviceOne->nPreGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_ ||
676  serviceOne->nPostGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_) {
677  edm::LogAbsolute("ExceptionThrowingProducer")
678  << "FAILED: Unexpected number of service transitions in TestServiceOne, global run";
679  testsPass = false;
680  }
681 
682  if (serviceTwo->nPreGlobalBeginRun() != nGlobalBeginRun || serviceTwo->nPostGlobalBeginRun() != nGlobalBeginRun ||
683  serviceTwo->nPreGlobalEndRun() != nGlobalBeginRun || serviceTwo->nPostGlobalEndRun() != nGlobalBeginRun ||
684  serviceTwo->nPreModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
685  serviceTwo->nPostModuleGlobalBeginRun() != nGlobalBeginRun * kNumberOfTestModules ||
686  serviceTwo->nPreModuleGlobalEndRun() !=
688  serviceTwo->nPostModuleGlobalEndRun() !=
690  serviceTwo->nPreGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_ ||
691  serviceTwo->nPostGlobalWriteRun() != nGlobalBeginRun - expectedOffsetNoWriteRun_) {
692  edm::LogAbsolute("ExceptionThrowingProducer")
693  << "FAILED: Unexpected number of service transitions in TestServiceTwo, global run";
694  testsPass = false;
695  }
696 
697  if (verbose_) {
698  edm::LogAbsolute("ExceptionThrowingProducer") << "nBeginJob_ = " << nBeginJob_;
699  edm::LogAbsolute("ExceptionThrowingProducer") << "nBeginStream_ = " << nBeginStream_.load();
700  edm::LogAbsolute("ExceptionThrowingProducer") << "nBeginProcessBlock_ = " << nBeginProcessBlock_;
701  edm::LogAbsolute("ExceptionThrowingProducer") << "nEndProcessBlock_ = " << nEndProcessBlock_;
702  edm::LogAbsolute("ExceptionThrowingProducer") << "nEndStream_ = " << nEndStream_.load();
703  edm::LogAbsolute("ExceptionThrowingProducer") << "nEndJob_ = " << nEndJob_ << "\n";
704 
705  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalBeginLumi_ = " << nGlobalBeginLumi_;
706  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalEndLumi_ = " << nGlobalEndLumi_;
707  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalBeginRun_ = " << nGlobalBeginRun_;
708  edm::LogAbsolute("ExceptionThrowingProducer") << "nGlobalEndRun_ = " << nGlobalEndRun_ << "\n";
709 
710  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPreBeginJob = " << serviceOne->nPreBeginJob();
711  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPostBeginJob = " << serviceOne->nPostBeginJob();
712  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPreEndJob = " << serviceOne->nPreEndJob();
713 
714  edm::LogAbsolute("ExceptionThrowingProducer")
715  << "serviceOne->nPreModuleBeginJob = " << serviceOne->nPreModuleBeginJob();
716  edm::LogAbsolute("ExceptionThrowingProducer")
717  << "serviceOne->nPostModuleBeginJob = " << serviceOne->nPostModuleBeginJob() << "\n";
718 
719  edm::LogAbsolute("ExceptionThrowingProducer")
720  << "serviceOne->nPreBeginStream = " << serviceOne->nPreBeginStream();
721  edm::LogAbsolute("ExceptionThrowingProducer")
722  << "serviceOne->nPostBeginStream = " << serviceOne->nPostBeginStream();
723  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPreEndStream = " << serviceOne->nPreEndStream();
724  edm::LogAbsolute("ExceptionThrowingProducer") << "serviceOne->nPostEndStream = " << serviceOne->nPostEndStream();
725 
726  edm::LogAbsolute("ExceptionThrowingProducer")
727  << "serviceOne->nPreModuleBeginStream = " << serviceOne->nPreModuleBeginStream();
728  edm::LogAbsolute("ExceptionThrowingProducer")
729  << "serviceOne->nPostModuleBeginStream = " << serviceOne->nPostModuleBeginStream();
730  edm::LogAbsolute("ExceptionThrowingProducer")
731  << "serviceOne->nPreModuleEndStream = " << serviceOne->nPreModuleEndStream();
732  edm::LogAbsolute("ExceptionThrowingProducer")
733  << "serviceOne->nPostModuleEndStream = " << serviceOne->nPostModuleEndStream() << "\n";
734 
735  edm::LogAbsolute("ExceptionThrowingProducer")
736  << "serviceOne->nPreBeginProcessBlock = " << serviceOne->nPreBeginProcessBlock();
737  edm::LogAbsolute("ExceptionThrowingProducer")
738  << "serviceOne->nPostBeginProcessBlock = " << serviceOne->nPostBeginProcessBlock();
739  edm::LogAbsolute("ExceptionThrowingProducer")
740  << "serviceOne->nPreEndProcessBlock = " << serviceOne->nPreEndProcessBlock();
741  edm::LogAbsolute("ExceptionThrowingProducer")
742  << "serviceOne->nPostEndProcessBlock = " << serviceOne->nPostEndProcessBlock();
743 
744  edm::LogAbsolute("ExceptionThrowingProducer")
745  << "serviceOne->nPreModuleBeginProcessBlock = " << serviceOne->nPreModuleBeginProcessBlock();
746  edm::LogAbsolute("ExceptionThrowingProducer")
747  << "serviceOne->nPostModuleBeginProcessBlock = " << serviceOne->nPostModuleBeginProcessBlock();
748  edm::LogAbsolute("ExceptionThrowingProducer")
749  << "serviceOne->nPreModuleEndProcessBlock = " << serviceOne->nPreModuleEndProcessBlock();
750  edm::LogAbsolute("ExceptionThrowingProducer")
751  << "serviceOne->nPostModuleEndProcessBlock = " << serviceOne->nPostModuleEndProcessBlock() << "\n";
752 
753  edm::LogAbsolute("ExceptionThrowingProducer")
754  << "serviceOne->nPreStreamBeginLumi = " << serviceOne->nPreStreamBeginLumi();
755  edm::LogAbsolute("ExceptionThrowingProducer")
756  << "serviceOne->nPostStreamBeginLumi = " << serviceOne->nPostStreamBeginLumi();
757  edm::LogAbsolute("ExceptionThrowingProducer")
758  << "serviceOne->nPreStreamEndLumi = " << serviceOne->nPreStreamEndLumi();
759  edm::LogAbsolute("ExceptionThrowingProducer")
760  << "serviceOne->nPostStreamEndLumi = " << serviceOne->nPostStreamEndLumi();
761  edm::LogAbsolute("ExceptionThrowingProducer")
762  << "serviceOne->nPreModuleStreamBeginLumi = " << serviceOne->nPreModuleStreamBeginLumi();
763  edm::LogAbsolute("ExceptionThrowingProducer")
764  << "serviceOne->nPostModuleStreamBeginLumi = " << serviceOne->nPostModuleStreamBeginLumi();
765  edm::LogAbsolute("ExceptionThrowingProducer")
766  << "serviceOne->nPreModuleStreamEndLumi = " << serviceOne->nPreModuleStreamEndLumi();
767  edm::LogAbsolute("ExceptionThrowingProducer")
768  << "serviceOne->nPostModuleStreamEndLumi = " << serviceOne->nPostModuleStreamEndLumi() << "\n";
769 
770  edm::LogAbsolute("ExceptionThrowingProducer")
771  << "serviceOne->nPreGlobalBeginLumi = " << serviceOne->nPreGlobalBeginLumi();
772  edm::LogAbsolute("ExceptionThrowingProducer")
773  << "serviceOne->nPostGlobalBeginLumi = " << serviceOne->nPostGlobalBeginLumi();
774  edm::LogAbsolute("ExceptionThrowingProducer")
775  << "serviceOne->nPreGlobalEndLumi = " << serviceOne->nPreGlobalEndLumi();
776  edm::LogAbsolute("ExceptionThrowingProducer")
777  << "serviceOne->nPostGlobalEndLumi = " << serviceOne->nPostGlobalEndLumi();
778  edm::LogAbsolute("ExceptionThrowingProducer")
779  << "serviceOne->nPreModuleGlobalBeginLumi = " << serviceOne->nPreModuleGlobalBeginLumi();
780  edm::LogAbsolute("ExceptionThrowingProducer")
781  << "serviceOne->nPostModuleGlobalBeginLumi = " << serviceOne->nPostModuleGlobalBeginLumi();
782  edm::LogAbsolute("ExceptionThrowingProducer")
783  << "serviceOne->nPreModuleGlobalEndLumi = " << serviceOne->nPreModuleGlobalEndLumi();
784  edm::LogAbsolute("ExceptionThrowingProducer")
785  << "serviceOne->nPostModuleGlobalEndLumi = " << serviceOne->nPostModuleGlobalEndLumi();
786  edm::LogAbsolute("ExceptionThrowingProducer")
787  << "serviceOne->nPreGlobalWriteLumi = " << serviceOne->nPreGlobalWriteLumi();
788  edm::LogAbsolute("ExceptionThrowingProducer")
789  << "serviceOne->nPostGlobalWriteLumi = " << serviceOne->nPostGlobalWriteLumi() << "\n";
790 
791  edm::LogAbsolute("ExceptionThrowingProducer")
792  << "serviceOne->nPreStreamBeginRun = " << serviceOne->nPreStreamBeginRun();
793  edm::LogAbsolute("ExceptionThrowingProducer")
794  << "serviceOne->nPostStreamBeginRun = " << serviceOne->nPostStreamBeginRun();
795  edm::LogAbsolute("ExceptionThrowingProducer")
796  << "serviceOne->nPreStreamEndRun = " << serviceOne->nPreStreamEndRun();
797  edm::LogAbsolute("ExceptionThrowingProducer")
798  << "serviceOne->nPostStreamEndRun = " << serviceOne->nPostStreamEndRun();
799  edm::LogAbsolute("ExceptionThrowingProducer")
800  << "serviceOne->nPreModuleStreamBeginRun = " << serviceOne->nPreModuleStreamBeginRun();
801  edm::LogAbsolute("ExceptionThrowingProducer")
802  << "serviceOne->nPostModuleStreamBeginRun = " << serviceOne->nPostModuleStreamBeginRun();
803  edm::LogAbsolute("ExceptionThrowingProducer")
804  << "serviceOne->nPreModuleStreamEndRun = " << serviceOne->nPreModuleStreamEndRun();
805  edm::LogAbsolute("ExceptionThrowingProducer")
806  << "serviceOne->nPostModuleStreamEndRun = " << serviceOne->nPostModuleStreamEndRun() << "\n";
807 
808  edm::LogAbsolute("ExceptionThrowingProducer")
809  << "serviceOne->nPreGlobalBeginRun = " << serviceOne->nPreGlobalBeginRun();
810  edm::LogAbsolute("ExceptionThrowingProducer")
811  << "serviceOne->nPostGlobalBeginRun = " << serviceOne->nPostGlobalBeginRun();
812  edm::LogAbsolute("ExceptionThrowingProducer")
813  << "serviceOne->nPreGlobalEndRun = " << serviceOne->nPreGlobalEndRun();
814  edm::LogAbsolute("ExceptionThrowingProducer")
815  << "serviceOne->nPostGlobalEndRun = " << serviceOne->nPostGlobalEndRun();
816  edm::LogAbsolute("ExceptionThrowingProducer")
817  << "serviceOne->nPreModuleGlobalBeginRun = " << serviceOne->nPreModuleGlobalBeginRun();
818  edm::LogAbsolute("ExceptionThrowingProducer")
819  << "serviceOne->nPostModuleGlobalBeginRun = " << serviceOne->nPostModuleGlobalBeginRun();
820  edm::LogAbsolute("ExceptionThrowingProducer")
821  << "serviceOne->nPreModuleGlobalEndRun = " << serviceOne->nPreModuleGlobalEndRun();
822  edm::LogAbsolute("ExceptionThrowingProducer")
823  << "serviceOne->nPostModuleGlobalEndRun = " << serviceOne->nPostModuleGlobalEndRun();
824  edm::LogAbsolute("ExceptionThrowingProducer")
825  << "serviceOne->nPreGlobalWriteRun = " << serviceOne->nPreGlobalWriteRun();
826  edm::LogAbsolute("ExceptionThrowingProducer")
827  << "serviceOne->nPostGlobalWriteRun = " << serviceOne->nPostGlobalWriteRun() << "\n";
828  }
829 
830  if (testsPass) {
831  edm::LogAbsolute("ExceptionThrowingProducer") << "All tests in ExceptionThrowingProducer PASSED";
832  } else {
833  edm::LogAbsolute("ExceptionThrowingProducer") << "At least one test in ExceptionThrowingProducer FAILED";
834  }
835 
836  if (throwInEndJob_) {
837  throw cms::Exception("IntentionalTestException")
838  << "ExceptionThrowingProducer::endJob, module configured to throw during endJob";
839  }
840  }
unsigned int nPreStreamEndLumi() const
unsigned int nPostBeginJob() const
unsigned int nPreModuleGlobalBeginLumi() const
std::vector< unsigned int > nStreamBeginRun_
unsigned int nPreStreamBeginLumi() const
unsigned int nPreStreamBeginRun() const
unsigned int nPostBeginProcessBlock() const
unsigned int nPreStreamBeginLumi() const
unsigned int nPreModuleStreamBeginLumi() const
std::vector< unsigned int > nStreamBeginLumi_
unsigned int nPreModuleGlobalBeginLumi() const
unsigned int nPostGlobalEndLumi() const
unsigned int nPostStreamBeginLumi() const
unsigned int nPostModuleStreamEndLumi() const
unsigned int nPreGlobalEndRun() const
unsigned int nPostGlobalBeginRun() const
unsigned int nPreModuleStreamBeginRun() const
unsigned int nPreGlobalBeginLumi() const
constexpr unsigned int kNumberOfModulesWithJobTransitions
unsigned int nPostGlobalBeginLumi() const
unsigned int nPostStreamBeginRun() const
unsigned int nPreBeginProcessBlock() const
unsigned int nPreModuleBeginJob() const
unsigned int nPreModuleGlobalEndRun() const
std::atomic< unsigned int > nGlobalBeginLumi_
unsigned int nPostGlobalEndLumi() const
unsigned int nPostModuleGlobalEndRun() const
unsigned int nPreGlobalEndLumi() const
unsigned int nPostGlobalWriteLumi() const
unsigned int nPreModuleBeginProcessBlock() const
unsigned int nPostModuleStreamBeginLumi() const
unsigned int nPostModuleEndProcessBlock() const
unsigned int nPreModuleBeginStream() const
unsigned int nPreGlobalBeginLumi() const
unsigned int nPreEndJob() const
unsigned int nPreEndStream() const
unsigned int nPreModuleStreamBeginLumi() const
unsigned int nPostModuleGlobalBeginLumi() const
unsigned int nPreGlobalWriteRun() const
unsigned int nPostStreamBeginLumi() const
unsigned int nPreStreamBeginRun() const
unsigned int nPostGlobalBeginRun() const
constexpr unsigned int kNumberOfModulesWithStreamTransitions
unsigned int nPostGlobalEndRun() const
unsigned int nPreModuleStreamBeginRun() const
unsigned int nPostStreamEndRun() const
unsigned int nPreBeginStream() const
unsigned int nPreGlobalEndRun() const
unsigned int nPreGlobalBeginRun() const
unsigned int nPreStreamEndLumi() const
unsigned int nPreModuleEndStream() const
unsigned int nPreModuleGlobalBeginRun() const
unsigned int nPreGlobalWriteLumi() const
unsigned int nPostModuleGlobalBeginLumi() const
unsigned int nPreStreamEndRun() const
unsigned int nPreGlobalWriteRun() const
unsigned int nPostModuleBeginProcessBlock() const
unsigned int nPreModuleGlobalEndLumi() const
constexpr unsigned int kNumberOfTestModules
unsigned int nPostModuleBeginJob() const
unsigned int nPreModuleGlobalBeginRun() const
unsigned int nPostModuleGlobalBeginRun() const
unsigned int nPostModuleGlobalEndLumi() const
unsigned int nPostModuleEndStream() const
unsigned int nPostModuleStreamEndLumi() const
unsigned int nPostGlobalWriteLumi() const
unsigned int nPreGlobalWriteLumi() const
unsigned int nPostEndStream() const
unsigned int nPostStreamEndLumi() const
unsigned int nPreBeginJob() const
unsigned int nPostModuleGlobalBeginRun() const
unsigned int nPostGlobalBeginLumi() const
unsigned int nPostModuleStreamBeginRun() const
unsigned int nPostModuleGlobalEndLumi() const
unsigned int nPostModuleGlobalEndRun() const
constexpr unsigned int kUnset
unsigned int nPreStreamEndRun() const
unsigned int nPreModuleStreamEndLumi() const
unsigned int nPreModuleStreamEndRun() const
unsigned int nPostModuleStreamEndRun() const
unsigned int nPreModuleEndProcessBlock() const
unsigned int nPreModuleGlobalEndLumi() const
unsigned int nPostEndProcessBlock() const
unsigned int nPostBeginStream() const
unsigned int nPostStreamEndRun() const
unsigned int nPostGlobalWriteRun() const
unsigned int nPreModuleStreamEndLumi() const
unsigned int nPostGlobalWriteRun() const
unsigned int nPostModuleStreamEndRun() const
Log< level::System, true > LogAbsolute
unsigned int nPreModuleGlobalEndRun() const
unsigned int nPostGlobalEndRun() const
std::atomic< unsigned int > nGlobalBeginRun_
unsigned int nPreModuleStreamEndRun() const
constexpr unsigned int kNumberOfModulesWithProcessBlockTransitions
unsigned int nPostModuleStreamBeginRun() const
unsigned int nPostStreamBeginRun() const
unsigned int nPostModuleBeginStream() const
unsigned int nPostModuleStreamBeginLumi() const
unsigned int nPreGlobalEndLumi() const
unsigned int nPostStreamEndLumi() const
unsigned int nPreGlobalBeginRun() const
unsigned int nPreEndProcessBlock() const

◆ endProcessBlock()

void edmtest::ExceptionThrowingProducer::endProcessBlock ( edm::ProcessBlock const &  processBlock)
override

Definition at line 385 of file ExceptionThrowingProducer.cc.

References Exception, nEndProcessBlock_, and throwInEndProcessBlock_.

385  {
388  throw cms::Exception("IntentionalTestException")
389  << "ExceptionThrowingProducer::endProcessBlock, module configured to throw during endProcessBlock";
390  }
391  }

◆ endStream()

void edmtest::ExceptionThrowingProducer::endStream ( edm::StreamID  streamID) const
override

Definition at line 368 of file ExceptionThrowingProducer.cc.

References Exception, kStreamToThrowOn, nEndStream_, throwInEndStream_, and edm::StreamID::value().

368  {
369  ++nEndStream_;
370  if (throwInEndStream_ && streamID.value() == kStreamToThrowOn) {
371  throw cms::Exception("IntentionalTestException")
372  << "ExceptionThrowingProducer::endStream, module configured to throw during endStream for stream: "
373  << kStreamToThrowOn;
374  }
375  }
constexpr unsigned int kStreamToThrowOn
unsigned int value() const
Definition: StreamID.h:43

◆ fillDescriptions()

void edmtest::ExceptionThrowingProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 842 of file ExceptionThrowingProducer.cc.

References edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, and kUnset.

842  {
844  edm::EventID invalidEventID;
845  desc.addUntracked<bool>("verbose", false);
846  desc.addUntracked<edm::EventID>("eventIDThrowOnEvent", invalidEventID);
847  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalBeginRun", invalidEventID);
848  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalBeginLumi", invalidEventID);
849  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalEndRun", invalidEventID);
850  desc.addUntracked<edm::EventID>("eventIDThrowOnGlobalEndLumi", invalidEventID);
851  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamBeginRun", invalidEventID);
852  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamBeginLumi", invalidEventID);
853  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamEndRun", invalidEventID);
854  desc.addUntracked<edm::EventID>("eventIDThrowOnStreamEndLumi", invalidEventID);
855 
856  desc.addUntracked<bool>("throwInBeginJob", false);
857  desc.addUntracked<bool>("throwInBeginStream", false);
858  desc.addUntracked<bool>("throwInBeginProcessBlock", false);
859  desc.addUntracked<bool>("throwInEndProcessBlock", false);
860  desc.addUntracked<bool>("throwInEndStream", false);
861  desc.addUntracked<bool>("throwInEndJob", false);
862 
863  desc.addUntracked<unsigned int>("expectedNBeginJob", 1);
864  desc.addUntracked<unsigned int>("expectedNBeginStream", 4);
865  desc.addUntracked<unsigned int>("expectedNBeginProcessBlock", 1);
866  desc.addUntracked<unsigned int>("expectedNEndProcessBlock", 1);
867  desc.addUntracked<unsigned int>("expectedNEndStream", 4);
868  desc.addUntracked<unsigned int>("expectedNEndJob", 1);
869  desc.addUntracked<bool>("expectNoRunsProcessed", false);
870  desc.addUntracked<unsigned int>("expectedOffsetNoEndJob", 0);
871  desc.addUntracked<unsigned int>("expectedOffsetNoEndStream", 0);
872  desc.addUntracked<unsigned int>("expectedOffsetNoEndProcessBlock", 0);
873  desc.addUntracked<unsigned int>("expectedStreamBeginLumi", kUnset);
874  desc.addUntracked<unsigned int>("expectedOffsetNoStreamEndLumi", 0);
875  desc.addUntracked<unsigned int>("expectedGlobalBeginLumi", 0);
876  desc.addUntracked<unsigned int>("expectedOffsetNoGlobalEndLumi", 0);
877  desc.addUntracked<unsigned int>("expectedOffsetNoWriteLumi", 0);
878 
879  desc.addUntracked<unsigned int>("expectedStreamBeginRun", kUnset);
880  desc.addUntracked<unsigned int>("expectedOffsetNoStreamEndRun", 0);
881  desc.addUntracked<unsigned int>("expectedGlobalBeginRun", 0);
882  desc.addUntracked<unsigned int>("expectedOffsetNoGlobalEndRun", 0);
883  desc.addUntracked<unsigned int>("expectedOffsetNoWriteRun", 0);
884 
885  descriptions.addDefault(desc);
886  }
void addDefault(ParameterSetDescription const &psetDescription)
constexpr unsigned int kUnset

◆ globalBeginLuminosityBlock()

std::shared_ptr< Cache > edmtest::ExceptionThrowingProducer::globalBeginLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &   
) const
override

Definition at line 260 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnGlobalBeginLumi_, Exception, globalBeginLumiExceptionOccurred_, edm::invalidEventNumber, and nGlobalBeginLumi_.

261  {
263  if (edm::EventID(lumi.id().run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
266  throw cms::Exception("IntentionalTestException")
267  << "ExceptionThrowingProducer::globalBeginLuminosityBlock, module configured to throw on: "
269  }
270  return std::make_shared<Cache>();
271  }
std::atomic< unsigned int > nGlobalBeginLumi_
EventNumber_t const invalidEventNumber

◆ globalBeginRun()

std::shared_ptr< Cache > edmtest::ExceptionThrowingProducer::globalBeginRun ( edm::Run const &  run,
edm::EventSetup const &   
) const
override

Definition at line 239 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnGlobalBeginRun_, Exception, globalBeginRunExceptionOccurred_, edm::invalidEventNumber, edm::invalidLuminosityBlockNumber, nGlobalBeginRun_, and writedatasetfile::run.

239  {
244  throw cms::Exception("IntentionalTestException")
245  << "ExceptionThrowingProducer::globalBeginRun, module configured to throw on: "
247  }
248  return std::make_shared<Cache>();
249  }
EventNumber_t const invalidEventNumber
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
std::atomic< unsigned int > nGlobalBeginRun_

◆ globalEndLuminosityBlock()

void edmtest::ExceptionThrowingProducer::globalEndLuminosityBlock ( edm::LuminosityBlock const &  lumi,
edm::EventSetup const &   
) const
override

Definition at line 273 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnGlobalEndLumi_, Exception, edm::invalidEventNumber, and nGlobalEndLumi_.

274  {
275  ++nGlobalEndLumi_;
276  if (edm::EventID(lumi.id().run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
278  throw cms::Exception("IntentionalTestException")
279  << "ExceptionThrowingProducer::globalEndLuminosityBlock, module configured to throw on: "
281  }
282  }
EventNumber_t const invalidEventNumber

◆ globalEndRun()

void edmtest::ExceptionThrowingProducer::globalEndRun ( edm::Run const &  run,
edm::EventSetup const &   
) const
override

Definition at line 251 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnGlobalEndRun_, Exception, edm::invalidEventNumber, edm::invalidLuminosityBlockNumber, nGlobalEndRun_, and writedatasetfile::run.

251  {
252  ++nGlobalEndRun_;
255  throw cms::Exception("IntentionalTestException")
256  << "ExceptionThrowingProducer::globalEndRun, module configured to throw on: " << eventIDThrowOnGlobalEndRun_;
257  }
258  }
EventNumber_t const invalidEventNumber
LuminosityBlockNumber_t const invalidLuminosityBlockNumber

◆ operator=() [1/2]

ExceptionThrowingProducer& edmtest::ExceptionThrowingProducer::operator= ( const ExceptionThrowingProducer )
delete

◆ operator=() [2/2]

ExceptionThrowingProducer& edmtest::ExceptionThrowingProducer::operator= ( ExceptionThrowingProducer &&  )
delete

◆ produce()

void edmtest::ExceptionThrowingProducer::produce ( edm::StreamID  ,
edm::Event event,
edm::EventSetup const &   
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 232 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnEvent_, and Exception.

232  {
233  if (event.id() == eventIDThrowOnEvent_) {
234  throw cms::Exception("IntentionalTestException")
235  << "ExceptionThrowingProducer::produce, module configured to throw on: " << eventIDThrowOnEvent_;
236  }
237  }
Definition: event.py:1

◆ streamBeginLuminosityBlock()

void edmtest::ExceptionThrowingProducer::streamBeginLuminosityBlock ( edm::StreamID  iStream,
edm::LuminosityBlock const &  lumi,
edm::EventSetup const &   
) const
override

Definition at line 313 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnStreamBeginLumi_, Exception, edm::invalidEventNumber, kTestStreams, nStreamBeginLumi_, streamBeginLumiExceptionOccurred_, streamWithBeginLumiException_, and edm::StreamID::value().

315  {
316  if (iStream < kTestStreams) {
317  ++nStreamBeginLumi_[iStream];
318  }
319 
320  // Throw if this lumi's ID matches the configured ID (this code is written so
321  // that only the first stream to match it will throw).
322  bool expected = false;
323  if (edm::EventID(lumi.run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
325  streamBeginLumiExceptionOccurred_.compare_exchange_strong(expected, true)) {
326  // Remember which stream threw
328 
329  throw cms::Exception("IntentionalTestException")
330  << "ExceptionThrowingProducer::streamBeginLuminosityBlock, module configured to throw on: "
332  }
333  }
constexpr unsigned int kTestStreams
std::vector< unsigned int > nStreamBeginLumi_
EventNumber_t const invalidEventNumber
unsigned int value() const
Definition: StreamID.h:43

◆ streamBeginRun()

void edmtest::ExceptionThrowingProducer::streamBeginRun ( edm::StreamID  iStream,
edm::Run const &  run,
edm::EventSetup const &   
) const
override

Definition at line 294 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnStreamBeginRun_, Exception, edm::invalidEventNumber, edm::invalidLuminosityBlockNumber, kTestStreams, nStreamBeginRun_, writedatasetfile::run, streamBeginRunExceptionOccurred_, streamWithBeginRunException_, and edm::StreamID::value().

296  {
297  if (iStream < kTestStreams) {
298  ++nStreamBeginRun_[iStream];
299  }
300 
301  bool expected = false;
304  streamBeginRunExceptionOccurred_.compare_exchange_strong(expected, true)) {
305  // Remember which stream threw
307  throw cms::Exception("IntentionalTestException")
308  << "ExceptionThrowingProducer::streamBeginRun, module configured to throw on: "
310  }
311  }
std::vector< unsigned int > nStreamBeginRun_
constexpr unsigned int kTestStreams
EventNumber_t const invalidEventNumber
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
unsigned int value() const
Definition: StreamID.h:43

◆ streamEndLuminosityBlock()

void edmtest::ExceptionThrowingProducer::streamEndLuminosityBlock ( edm::StreamID  iStream,
edm::LuminosityBlock const &  lumi,
edm::EventSetup const &   
) const
override

Definition at line 335 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnStreamEndLumi_, Exception, edm::invalidEventNumber, kTestStreams, nStreamEndLumi_, and streamEndLumiExceptionOccurred_.

337  {
338  if (iStream < kTestStreams) {
339  ++nStreamEndLumi_[iStream];
340  }
341 
342  bool expected = false;
343  if (edm::EventID(lumi.run(), lumi.id().luminosityBlock(), edm::invalidEventNumber) ==
345  streamEndLumiExceptionOccurred_.compare_exchange_strong(expected, true)) {
346  throw cms::Exception("IntentionalTestException")
347  << "ExceptionThrowingProducer::streamEndLuminosityBlock, module configured to throw on: "
349  }
350  }
constexpr unsigned int kTestStreams
EventNumber_t const invalidEventNumber

◆ streamEndRun()

void edmtest::ExceptionThrowingProducer::streamEndRun ( edm::StreamID  iStream,
edm::Run const &  run,
edm::EventSetup const &   
) const
override

Definition at line 352 of file ExceptionThrowingProducer.cc.

References eventIDThrowOnStreamEndRun_, Exception, edm::invalidEventNumber, edm::invalidLuminosityBlockNumber, kTestStreams, nStreamEndRun_, writedatasetfile::run, and streamEndRunExceptionOccurred_.

354  {
355  if (iStream < kTestStreams) {
356  ++nStreamEndRun_[iStream];
357  }
358 
359  bool expected = false;
362  streamEndRunExceptionOccurred_.compare_exchange_strong(expected, true)) {
363  throw cms::Exception("IntentionalTestException")
364  << "ExceptionThrowingProducer::streamEndRun, module configured to throw on: " << eventIDThrowOnStreamEndRun_;
365  }
366  }
constexpr unsigned int kTestStreams
EventNumber_t const invalidEventNumber
LuminosityBlockNumber_t const invalidLuminosityBlockNumber

Member Data Documentation

◆ eventIDThrowOnEvent_

const edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnEvent_
private

Definition at line 88 of file ExceptionThrowingProducer.cc.

Referenced by produce().

◆ eventIDThrowOnGlobalBeginLumi_

const edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnGlobalBeginLumi_
private

Definition at line 90 of file ExceptionThrowingProducer.cc.

Referenced by globalBeginLuminosityBlock().

◆ eventIDThrowOnGlobalBeginRun_

const edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnGlobalBeginRun_
private

Definition at line 89 of file ExceptionThrowingProducer.cc.

Referenced by globalBeginRun().

◆ eventIDThrowOnGlobalEndLumi_

const edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnGlobalEndLumi_
private

Definition at line 92 of file ExceptionThrowingProducer.cc.

Referenced by globalEndLuminosityBlock().

◆ eventIDThrowOnGlobalEndRun_

const edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnGlobalEndRun_
private

Definition at line 91 of file ExceptionThrowingProducer.cc.

Referenced by globalEndRun().

◆ eventIDThrowOnStreamBeginLumi_

const edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnStreamBeginLumi_
private

Definition at line 94 of file ExceptionThrowingProducer.cc.

Referenced by streamBeginLuminosityBlock().

◆ eventIDThrowOnStreamBeginRun_

const edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnStreamBeginRun_
private

Definition at line 93 of file ExceptionThrowingProducer.cc.

Referenced by streamBeginRun().

◆ eventIDThrowOnStreamEndLumi_

const edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnStreamEndLumi_
private

Definition at line 96 of file ExceptionThrowingProducer.cc.

Referenced by streamEndLuminosityBlock().

◆ eventIDThrowOnStreamEndRun_

const edm::EventID edmtest::ExceptionThrowingProducer::eventIDThrowOnStreamEndRun_
private

Definition at line 95 of file ExceptionThrowingProducer.cc.

Referenced by streamEndRun().

◆ expectedGlobalBeginLumi_

const unsigned int edmtest::ExceptionThrowingProducer::expectedGlobalBeginLumi_
private

Definition at line 136 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedGlobalBeginRun_

const unsigned int edmtest::ExceptionThrowingProducer::expectedGlobalBeginRun_
private

Definition at line 143 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedNBeginJob_

const unsigned int edmtest::ExceptionThrowingProducer::expectedNBeginJob_
private

Definition at line 121 of file ExceptionThrowingProducer.cc.

Referenced by ~ExceptionThrowingProducer().

◆ expectedNBeginProcessBlock_

const unsigned int edmtest::ExceptionThrowingProducer::expectedNBeginProcessBlock_
private

Definition at line 123 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedNBeginStream_

const unsigned int edmtest::ExceptionThrowingProducer::expectedNBeginStream_
private

Definition at line 122 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedNEndJob_

const unsigned int edmtest::ExceptionThrowingProducer::expectedNEndJob_
private

Definition at line 126 of file ExceptionThrowingProducer.cc.

Referenced by ~ExceptionThrowingProducer().

◆ expectedNEndProcessBlock_

const unsigned int edmtest::ExceptionThrowingProducer::expectedNEndProcessBlock_
private

Definition at line 124 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedNEndStream_

const unsigned int edmtest::ExceptionThrowingProducer::expectedNEndStream_
private

Definition at line 125 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoEndJob_

const unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoEndJob_
private

Definition at line 129 of file ExceptionThrowingProducer.cc.

Referenced by ~ExceptionThrowingProducer().

◆ expectedOffsetNoEndProcessBlock_

const unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoEndProcessBlock_
private

Definition at line 131 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoEndStream_

const unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoEndStream_
private

Definition at line 130 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoGlobalEndLumi_

const unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoGlobalEndLumi_
private

Definition at line 137 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoGlobalEndRun_

const unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoGlobalEndRun_
private

Definition at line 144 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoStreamEndLumi_

const unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoStreamEndLumi_
private

Definition at line 134 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoStreamEndRun_

const unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoStreamEndRun_
private

Definition at line 141 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoWriteLumi_

const unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoWriteLumi_
private

Definition at line 138 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedOffsetNoWriteRun_

const unsigned int edmtest::ExceptionThrowingProducer::expectedOffsetNoWriteRun_
private

Definition at line 145 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedStreamBeginLumi_

const unsigned int edmtest::ExceptionThrowingProducer::expectedStreamBeginLumi_
private

Definition at line 133 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectedStreamBeginRun_

const unsigned int edmtest::ExceptionThrowingProducer::expectedStreamBeginRun_
private

Definition at line 140 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ expectNoRunsProcessed_

const bool edmtest::ExceptionThrowingProducer::expectNoRunsProcessed_
private

Definition at line 127 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ globalBeginLumiExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::globalBeginLumiExceptionOccurred_ = false
mutableprivate

Definition at line 149 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and globalBeginLuminosityBlock().

◆ globalBeginRunExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::globalBeginRunExceptionOccurred_ = false
mutableprivate

Definition at line 153 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and globalBeginRun().

◆ nBeginJob_

unsigned int edmtest::ExceptionThrowingProducer::nBeginJob_ = 0
private

Definition at line 104 of file ExceptionThrowingProducer.cc.

Referenced by beginJob(), endJob(), and ~ExceptionThrowingProducer().

◆ nBeginProcessBlock_

unsigned int edmtest::ExceptionThrowingProducer::nBeginProcessBlock_ = 0
private

◆ nBeginStream_

std::atomic<unsigned int> edmtest::ExceptionThrowingProducer::nBeginStream_ {0}
mutableprivate

Definition at line 105 of file ExceptionThrowingProducer.cc.

Referenced by beginStream(), endJob(), and ~ExceptionThrowingProducer().

◆ nEndJob_

unsigned int edmtest::ExceptionThrowingProducer::nEndJob_ = 0
private

Definition at line 109 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and ~ExceptionThrowingProducer().

◆ nEndProcessBlock_

unsigned int edmtest::ExceptionThrowingProducer::nEndProcessBlock_ = 0
private

◆ nEndStream_

std::atomic<unsigned int> edmtest::ExceptionThrowingProducer::nEndStream_ {0}
mutableprivate

Definition at line 108 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), endStream(), and ~ExceptionThrowingProducer().

◆ nGlobalBeginLumi_

std::atomic<unsigned int> edmtest::ExceptionThrowingProducer::nGlobalBeginLumi_ {0}
mutableprivate

Definition at line 113 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and globalBeginLuminosityBlock().

◆ nGlobalBeginRun_

std::atomic<unsigned int> edmtest::ExceptionThrowingProducer::nGlobalBeginRun_ {0}
mutableprivate

◆ nGlobalEndLumi_

std::atomic<unsigned int> edmtest::ExceptionThrowingProducer::nGlobalEndLumi_ {0}
mutableprivate

Definition at line 114 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and globalEndLuminosityBlock().

◆ nGlobalEndRun_

std::atomic<unsigned int> edmtest::ExceptionThrowingProducer::nGlobalEndRun_ {0}
mutableprivate

Definition at line 119 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), globalEndRun(), and ~ExceptionThrowingProducer().

◆ nStreamBeginLumi_

std::vector<unsigned int> edmtest::ExceptionThrowingProducer::nStreamBeginLumi_
mutableprivate

Definition at line 111 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamBeginLuminosityBlock().

◆ nStreamBeginRun_

std::vector<unsigned int> edmtest::ExceptionThrowingProducer::nStreamBeginRun_
mutableprivate

Definition at line 116 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamBeginRun().

◆ nStreamEndLumi_

std::vector<unsigned int> edmtest::ExceptionThrowingProducer::nStreamEndLumi_
mutableprivate

Definition at line 112 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamEndLuminosityBlock().

◆ nStreamEndRun_

std::vector<unsigned int> edmtest::ExceptionThrowingProducer::nStreamEndRun_
mutableprivate

Definition at line 117 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamEndRun().

◆ streamBeginLumiExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::streamBeginLumiExceptionOccurred_ = false
mutableprivate

Definition at line 147 of file ExceptionThrowingProducer.cc.

Referenced by streamBeginLuminosityBlock().

◆ streamBeginRunExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::streamBeginRunExceptionOccurred_ = false
mutableprivate

Definition at line 151 of file ExceptionThrowingProducer.cc.

Referenced by streamBeginRun().

◆ streamEndLumiExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::streamEndLumiExceptionOccurred_ = false
mutableprivate

Definition at line 148 of file ExceptionThrowingProducer.cc.

Referenced by streamEndLuminosityBlock().

◆ streamEndRunExceptionOccurred_

std::atomic<bool> edmtest::ExceptionThrowingProducer::streamEndRunExceptionOccurred_ = false
mutableprivate

Definition at line 152 of file ExceptionThrowingProducer.cc.

Referenced by streamEndRun().

◆ streamWithBeginLumiException_

unsigned int edmtest::ExceptionThrowingProducer::streamWithBeginLumiException_ = kUnset
mutableprivate

Definition at line 135 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamBeginLuminosityBlock().

◆ streamWithBeginRunException_

unsigned int edmtest::ExceptionThrowingProducer::streamWithBeginRunException_ = kUnset
mutableprivate

Definition at line 142 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and streamBeginRun().

◆ throwInBeginJob_

const bool edmtest::ExceptionThrowingProducer::throwInBeginJob_
private

Definition at line 97 of file ExceptionThrowingProducer.cc.

Referenced by beginJob().

◆ throwInBeginProcessBlock_

const bool edmtest::ExceptionThrowingProducer::throwInBeginProcessBlock_
private

Definition at line 99 of file ExceptionThrowingProducer.cc.

Referenced by beginProcessBlock().

◆ throwInBeginStream_

const bool edmtest::ExceptionThrowingProducer::throwInBeginStream_
private

Definition at line 98 of file ExceptionThrowingProducer.cc.

Referenced by beginStream().

◆ throwInEndJob_

const bool edmtest::ExceptionThrowingProducer::throwInEndJob_
private

Definition at line 102 of file ExceptionThrowingProducer.cc.

Referenced by endJob().

◆ throwInEndProcessBlock_

const bool edmtest::ExceptionThrowingProducer::throwInEndProcessBlock_
private

Definition at line 100 of file ExceptionThrowingProducer.cc.

Referenced by endProcessBlock().

◆ throwInEndStream_

const bool edmtest::ExceptionThrowingProducer::throwInEndStream_
private

Definition at line 101 of file ExceptionThrowingProducer.cc.

Referenced by endStream().

◆ verbose_

const bool edmtest::ExceptionThrowingProducer::verbose_
private

Definition at line 86 of file ExceptionThrowingProducer.cc.

Referenced by endJob(), and ~ExceptionThrowingProducer().