File indexing completed on 2024-04-06 12:12:40
0001 import FWCore.ParameterSet.Config as cms
0002
0003 import sys
0004 import argparse
0005
0006 parser = argparse.ArgumentParser(prog=sys.argv[0], description='Test TryToContinue exception handling wrt ESProducer.')
0007
0008 parser.add_argument("--continueAnalyzer", help="Apply shouldTryToContinue to module dependent on module that fails.", action="store_true")
0009
0010 args = parser.parse_args()
0011
0012 process = cms.Process("Demo")
0013
0014 process.MessageLogger = cms.Service("MessageLogger")
0015
0016 process.maxEvents.input = 2
0017
0018 if args.continueAnalyzer:
0019 process.options.TryToContinue = ['StdException', 'MakeDataException']
0020 process.options.modulesToCallForTryToContinue = ['demo']
0021 else:
0022 process.options.TryToContinue = ['StdException']
0023
0024
0025 process.source = cms.Source("EmptySource",
0026 numberEventsInRun = cms.untracked.uint32(3)
0027 )
0028
0029
0030 process.WhatsItESProducer = cms.ESProducer("WhatsItESProducer")
0031 process.DoodadESProducer = cms.ESProducer("DoodadESProducer",
0032 throwException = cms.untracked.bool(True)
0033 )
0034
0035 process.demo = cms.EDAnalyzer("WhatsItAnalyzer",
0036 expectedValues = cms.untracked.vint32(0)
0037 )
0038
0039 process.bad = cms.ESSource("EmptyESSource",
0040 recordName = cms.string('GadgetRcd'),
0041 iovIsRunNotTime = cms.bool(True),
0042 firstValid = cms.vuint32(1)
0043 )
0044
0045 process.p = cms.Path(process.demo)