51 edm::LuminosityBlockCache<Cache>,
52 edm::WatchProcessBlock> {
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")) {}
201 <<
"ExceptionThrowingProducer::beginJob did not run expected number of times.";
202 edm::LogAbsolute(
"ExceptionThrowingProducer") <<
"At least one test in ExceptionThrowingProducer FAILED";
205 <<
"ExceptionThrowingProducer::endJob did not run expected number of times.";
206 edm::LogAbsolute(
"ExceptionThrowingProducer") <<
"At least one test in ExceptionThrowingProducer FAILED";
209 edm::LogAbsolute(
"ExceptionThrowingProducer") <<
"All tests in ExceptionThrowingProducer PASSED";
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";
235 <<
"ExceptionThrowingProducer::produce, module configured to throw on: " <<
eventIDThrowOnEvent_;
245 <<
"ExceptionThrowingProducer::globalBeginRun, module configured to throw on: " 248 return std::make_shared<Cache>();
267 <<
"ExceptionThrowingProducer::globalBeginLuminosityBlock, module configured to throw on: " 270 return std::make_shared<Cache>();
279 <<
"ExceptionThrowingProducer::globalEndLuminosityBlock, module configured to throw on: " 288 <<
"ExceptionThrowingProducer::beginStream, module configured to throw during beginStream for stream: " 291 return std::make_unique<Cache>();
301 bool expected =
false;
308 <<
"ExceptionThrowingProducer::streamBeginRun, module configured to throw on: " 322 bool expected =
false;
330 <<
"ExceptionThrowingProducer::streamBeginLuminosityBlock, module configured to throw on: " 342 bool expected =
false;
347 <<
"ExceptionThrowingProducer::streamEndLuminosityBlock, module configured to throw on: " 359 bool expected =
false;
372 <<
"ExceptionThrowingProducer::endStream, module configured to throw during endStream for stream: " 381 <<
"ExceptionThrowingProducer::beginProcessBlock, module configured to throw during beginProcessBlock";
389 <<
"ExceptionThrowingProducer::endProcessBlock, module configured to throw during endProcessBlock";
397 <<
"ExceptionThrowingProducer::beginJob, module configured to throw during beginJob";
404 bool testsPass =
true;
408 <<
"FAILED: Unexpected number of beginStream transitions, saw: " <<
nBeginStream_.load()
415 <<
"FAILED: Unexpected number of beginProcessBlock transitions, saw: " <<
nBeginProcessBlock_ 422 <<
"FAILED: Unexpected number of endProcessBlock transitions, saw: " <<
nEndProcessBlock_ 429 <<
"FAILED: Unexpected number of endStream transitions, saw: " <<
nEndStream_.load()
436 <<
"FAILED: Unexpected number of globalBeginRun transitions, saw: " <<
nGlobalBeginRun_.load()
437 <<
" expected: " << 0;
441 unsigned int totalStreamBeginLumi = 0;
444 totalStreamBeginLumi += nStreamBeginLumi;
451 <<
"FAILED: More than maximum possible number of streamBeginLumi transitions, stream " <<
i <<
" saw " 455 unsigned int expectedStreamEndLumi =
459 <<
"FAILED: Unexpected number of streamEndLumi transitions, stream " <<
i <<
" saw " <<
nStreamEndLumi_[
i]
460 <<
" expected " << expectedStreamEndLumi;
467 unsigned int totalStreamBeginRun = 0;
470 totalStreamBeginRun += nStreamBeginRun;
477 <<
"FAILED: More than maximum possible number of streamBeginRun transitions, stream " <<
i <<
" saw " 484 <<
"FAILED: Unexpected number of streamEndRun transitions, stream " <<
i <<
" saw " <<
nStreamEndRun_[
i]
485 <<
" expected " << expectedStreamEndRun;
497 <<
"FAILED: Less than the expected number of globalBeginLumi transitions, expected at least " 507 <<
"FAILED: Less than the expected number of globalBeginRun transitions, expected at least " 512 unsigned int expectedGlobalEndLumi =
516 <<
"FAILED: number of global end lumi transitions not equal to expected value, expected " 521 unsigned int expectedGlobalEndRun =
525 <<
"FAILED: number of global end run transitions not equal to expected value, expected " 536 <<
"FAILED: Unexpected number of service transitions in TestServiceOne, beginJob and endJob";
549 <<
"FAILED: Unexpected number of service transitions in TestServiceOne, beginStream and endStream";
565 edm::LogAbsolute(
"ExceptionThrowingProducer") <<
"FAILED: Unexpected number of service transitions in " 566 "TestServiceOne, beginProcessBlock and endProcessBlock";
581 <<
"FAILED: Unexpected number of service transitions in TestServiceOne, stream lumi";
597 <<
"FAILED: Unexpected number of service transitions in TestServiceTwo, stream lumi";
615 <<
"FAILED: Unexpected number of service transitions in TestServiceOne, global lumi";
631 <<
"FAILED: Unexpected number of service transitions in TestServiceTwo, global lumi";
646 <<
"FAILED: Unexpected number of service transitions in TestServiceOne, stream run";
661 <<
"FAILED: Unexpected number of service transitions in TestServiceTwo, stream run";
678 <<
"FAILED: Unexpected number of service transitions in TestServiceOne, global run";
693 <<
"FAILED: Unexpected number of service transitions in TestServiceTwo, global run";
831 edm::LogAbsolute(
"ExceptionThrowingProducer") <<
"All tests in ExceptionThrowingProducer PASSED";
833 edm::LogAbsolute(
"ExceptionThrowingProducer") <<
"At least one test in ExceptionThrowingProducer FAILED";
838 <<
"ExceptionThrowingProducer::endJob, module configured to throw during endJob";
845 desc.addUntracked<
bool>(
"verbose",
false);
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);
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);
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);
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);
void endProcessBlock(edm::ProcessBlock const &processBlock) override
unsigned int nPreStreamEndLumi() const
const unsigned int expectedGlobalBeginRun_
const bool throwInEndStream_
const unsigned int expectedStreamBeginLumi_
unsigned int nPostBeginJob() const
unsigned int nPreModuleGlobalBeginLumi() const
std::vector< unsigned int > nStreamBeginRun_
const unsigned int expectedNEndStream_
unsigned int nPreStreamBeginLumi() const
unsigned int nPreStreamBeginRun() const
unsigned int nPostBeginProcessBlock() const
unsigned int nPreModuleEndJob() const
constexpr unsigned int kTestStreams
unsigned int nPreStreamBeginLumi() const
unsigned int nPreModuleStreamBeginLumi() const
const bool throwInEndProcessBlock_
ExceptionThrowingProducer & operator=(const ExceptionThrowingProducer &)=delete
std::vector< unsigned int > nStreamBeginLumi_
std::atomic< unsigned int > nBeginStream_
std::atomic< bool > streamEndLumiExceptionOccurred_
unsigned int nPreModuleGlobalBeginLumi() const
const bool throwInBeginStream_
unsigned int nPostGlobalEndLumi() const
unsigned int nPostStreamBeginLumi() const
std::shared_ptr< Cache > globalBeginLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
std::unique_ptr< Cache > beginStream(edm::StreamID) const override
unsigned int nPostModuleStreamEndLumi() const
unsigned int nPreGlobalEndRun() const
unsigned int nPostGlobalBeginRun() const
unsigned int nPreModuleStreamBeginRun() const
unsigned int nPreGlobalBeginLumi() const
constexpr unsigned int kNumberOfModulesWithJobTransitions
std::atomic< bool > streamBeginRunExceptionOccurred_
unsigned int nPostGlobalBeginLumi() const
unsigned int nPostStreamBeginRun() const
const unsigned int expectedGlobalBeginLumi_
unsigned int nPreBeginProcessBlock() const
std::atomic< bool > streamBeginLumiExceptionOccurred_
std::atomic< bool > globalBeginLumiExceptionOccurred_
const edm::EventID eventIDThrowOnGlobalEndLumi_
unsigned int nPreModuleBeginJob() const
std::vector< unsigned int > nStreamEndRun_
const unsigned int expectedOffsetNoEndProcessBlock_
unsigned int nPreModuleGlobalEndRun() const
static void fillDescriptions(edm::ConfigurationDescriptions &)
std::atomic< unsigned int > nGlobalBeginLumi_
unsigned int nPostGlobalEndLumi() const
unsigned int nPostModuleGlobalEndRun() const
const unsigned int expectedNBeginStream_
unsigned int nPreGlobalEndLumi() const
const bool throwInEndJob_
std::atomic< bool > globalBeginRunExceptionOccurred_
unsigned int nPostGlobalWriteLumi() const
unsigned int nPreModuleBeginProcessBlock() const
unsigned int nPostModuleStreamBeginLumi() const
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const override
unsigned int nPostModuleEndProcessBlock() const
unsigned int nPreModuleBeginStream() const
unsigned int nPostModuleEndJob() const
const unsigned int expectedOffsetNoWriteLumi_
EventNumber_t const invalidEventNumber
unsigned int nPreGlobalBeginLumi() const
unsigned int nPreEndJob() const
unsigned int nPreEndStream() const
const edm::EventID eventIDThrowOnGlobalBeginLumi_
unsigned int nPreModuleStreamBeginLumi() const
void addDefault(ParameterSetDescription const &psetDescription)
unsigned int nPostModuleGlobalBeginLumi() const
const edm::EventID eventIDThrowOnStreamEndLumi_
unsigned int streamWithBeginLumiException_
const edm::EventID eventIDThrowOnEvent_
unsigned int streamWithBeginRunException_
unsigned int nPreGlobalWriteRun() const
unsigned int nPostStreamBeginLumi() const
unsigned int nPreStreamBeginRun() const
unsigned int nPostGlobalBeginRun() const
const unsigned int expectedNEndJob_
constexpr unsigned int kNumberOfModulesWithStreamTransitions
unsigned int nPostGlobalEndRun() const
constexpr unsigned int kStreamToThrowOn
unsigned int nBeginProcessBlock_
unsigned int nPreModuleStreamBeginRun() const
unsigned int nEndProcessBlock_
std::atomic< unsigned int > nGlobalEndRun_
const unsigned int expectedNEndProcessBlock_
const unsigned int expectedOffsetNoStreamEndLumi_
unsigned int nPostStreamEndRun() const
std::atomic< unsigned int > nEndStream_
const unsigned int expectedOffsetNoGlobalEndLumi_
unsigned int nPreBeginStream() const
const edm::EventID eventIDThrowOnGlobalBeginRun_
const unsigned int expectedNBeginJob_
unsigned int nPreGlobalEndRun() const
unsigned int nPreGlobalBeginRun() const
#define DEFINE_FWK_MODULE(type)
void streamBeginLuminosityBlock(edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
std::atomic< bool > streamEndRunExceptionOccurred_
const edm::EventID eventIDThrowOnGlobalEndRun_
unsigned int nPreStreamEndLumi() const
unsigned int nPreModuleEndStream() const
unsigned int nPreModuleGlobalBeginRun() const
void endStream(edm::StreamID) const override
const edm::EventID eventIDThrowOnStreamBeginRun_
void streamBeginRun(edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
unsigned int nPreGlobalWriteLumi() const
unsigned int nPostModuleGlobalBeginLumi() const
LuminosityBlockNumber_t const invalidLuminosityBlockNumber
void globalEndLuminosityBlock(edm::LuminosityBlock const &, edm::EventSetup const &) const override
unsigned int nPreStreamEndRun() const
unsigned int nPreGlobalWriteRun() const
unsigned int nPostModuleBeginProcessBlock() const
unsigned int nPreModuleGlobalEndLumi() const
constexpr unsigned int kNumberOfTestModules
const bool expectNoRunsProcessed_
unsigned int nPostModuleBeginJob() const
unsigned int nPreModuleGlobalBeginRun() const
unsigned int nPostModuleGlobalBeginRun() const
std::shared_ptr< Cache > globalBeginRun(edm::Run const &, edm::EventSetup const &) const override
const edm::EventID eventIDThrowOnStreamBeginLumi_
unsigned int nPostModuleGlobalEndLumi() const
unsigned int nPostModuleEndStream() const
unsigned int nPostModuleStreamEndLumi() const
const unsigned int expectedOffsetNoGlobalEndRun_
unsigned int nPostGlobalWriteLumi() const
unsigned int nPreGlobalWriteLumi() const
unsigned int nPostEndStream() const
const unsigned int expectedNBeginProcessBlock_
unsigned int nPostStreamEndLumi() const
unsigned int nPreBeginJob() const
unsigned int nPostModuleGlobalBeginRun() const
unsigned int nPostGlobalBeginLumi() const
ExceptionThrowingProducer(edm::ParameterSet const &)
std::atomic< unsigned int > nGlobalEndLumi_
void streamEndRun(edm::StreamID, edm::Run const &, edm::EventSetup const &) const override
unsigned int nPostModuleStreamBeginRun() const
unsigned int nPostModuleGlobalEndLumi() const
const unsigned int expectedStreamBeginRun_
~ExceptionThrowingProducer() noexcept(false) override
unsigned int nPostModuleGlobalEndRun() const
constexpr unsigned int kUnset
unsigned int nPreStreamEndRun() const
unsigned int nPreModuleStreamEndLumi() const
void streamEndLuminosityBlock(edm::StreamID, edm::LuminosityBlock const &, edm::EventSetup const &) const override
unsigned int nPreModuleStreamEndRun() const
const unsigned int expectedOffsetNoEndJob_
const unsigned int expectedOffsetNoWriteRun_
unsigned int nPostModuleStreamEndRun() const
unsigned int nPreModuleEndProcessBlock() const
unsigned int nPreModuleGlobalEndLumi() const
const unsigned int expectedOffsetNoEndStream_
void globalEndRun(edm::Run const &, edm::EventSetup const &) const override
unsigned int nPostEndProcessBlock() const
unsigned int nPostBeginStream() const
std::vector< unsigned int > nStreamEndLumi_
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
unsigned int nPostEndJob() const
unsigned int value() const
std::atomic< unsigned int > nGlobalBeginRun_
const bool throwInBeginProcessBlock_
unsigned int nPreModuleStreamEndRun() const
void beginProcessBlock(edm::ProcessBlock const &processBlock) override
const unsigned int expectedOffsetNoStreamEndRun_
constexpr unsigned int kNumberOfModulesWithProcessBlockTransitions
unsigned int nPostModuleStreamBeginRun() const
unsigned int nPostStreamBeginRun() const
unsigned int nPostModuleBeginStream() const
unsigned int nPostModuleStreamBeginLumi() const
const bool throwInBeginJob_
const edm::EventID eventIDThrowOnStreamEndRun_
unsigned int nPreGlobalEndLumi() const
unsigned int nPostStreamEndLumi() const
unsigned int nPreGlobalBeginRun() const
unsigned int nPreEndProcessBlock() const