From 191b0f9a26c49a6bbf15c3f19781ea5b6cff41e6 Mon Sep 17 00:00:00 2001 From: Rosen Matev Date: Mon, 21 Mar 2022 16:05:36 +0100 Subject: [PATCH] Fix race condition in tests Tests were trying to write to the same output files, which sometimes causes corruptions and failures in the validators. --- .../tupling/example-tupling-basic-run-mc.yaml | 4 ++-- .../option_davinci_tupling_from_hlt2_gaudirun.py | 2 +- .../tests/refs/test_davinci_tupling-basic-run-mc.ref | 10 +++++----- .../refs/test_davinci_tupling_from_hlt2_gaudirun.ref | 11 +++++------ 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-basic-run-mc.yaml b/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-basic-run-mc.yaml index f72da063..364057f9 100644 --- a/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-basic-run-mc.yaml +++ b/DaVinciExamples/python/DaVinciExamples/tupling/example-tupling-basic-run-mc.yaml @@ -11,8 +11,8 @@ enable_unpack: False evt_max: 10 -histo_file: 'DV-example-tupling-basic-his.root' +histo_file: 'DV-example-tupling-basic-his-run-mc.root' input_raw_format: 4.3 lumi: False -ntuple_file: 'DV-example-tupling-basic-ntp.root' +ntuple_file: 'DV-example-tupling-basic-ntp-run-mc.root' process: 'Turbo' diff --git a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2_gaudirun.py b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2_gaudirun.py index 2255abaa..18bdbed6 100644 --- a/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2_gaudirun.py +++ b/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2_gaudirun.py @@ -62,7 +62,7 @@ def main(): return {"UserAlgs": [my_filter, my_tuple]}, [] -options.ntuple_file = "tuple_D0_Kpi_10evts.root" +options.ntuple_file = "tuple_D0_Kpi_10evts_gaudirun.root" options.annsvc_config = "root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/NovemberFEST/hlt2_D0_Kpi_10evts.tck.json" options.process = 'Hlt2' options.input_raw_format = 0.3 diff --git a/DaVinciExamples/tests/refs/test_davinci_tupling-basic-run-mc.ref b/DaVinciExamples/tests/refs/test_davinci_tupling-basic-run-mc.ref index f836dafb..7fff370d 100644 --- a/DaVinciExamples/tests/refs/test_davinci_tupling-basic-run-mc.ref +++ b/DaVinciExamples/tests/refs/test_davinci_tupling-basic-run-mc.ref @@ -6,8 +6,8 @@ ApplicationMgr SUCCESS ApplicationMgr INFO Application Manager Configured successfully DetectorPersistencySvc INFO Added successfully Conversion service:XmlCnvSvc DetectorDataSvc SUCCESS Detector description database: git:/lhcb.xml -NTupleSvc INFO Added stream file:DV-example-tupling-basic-ntp.root as FILE1 -RootHistSvc INFO Writing ROOT histograms to: DV-example-tupling-basic-his.root +NTupleSvc INFO Added stream file:DV-example-tupling-basic-ntp-run-mc.root as FILE1 +RootHistSvc INFO Writing ROOT histograms to: DV-example-tupling-basic-his-run-mc.root HistogramPersistencySvc INFO Added successfully Conversion service:RootHistSvc FSROutputStreamDstWriter INFO Data source: EventDataSvc output: SVC='Gaudi::RootCnvSvc' EventClockSvc.FakeEventTime INFO Event times generated from 0 with steps of 0 @@ -19,8 +19,8 @@ ApplicationMgr INFO Application Manager Started successf EventPersistencySvc INFO Added successfully Conversion service:RootCnvSvc EventSelector SUCCESS Reading Event record 1. Record number within stream 1: 1 ToolSvc.LoKi::VertexFitter INFO Option for Optimised Kalman Filter fit is activated -RFileCnv INFO opening Root file "DV-example-tupling-basic-ntp.root" for writing -RCWNTupleCnv INFO Booked TTree with ID: DecayTree "DecayTree" in directory DV-example-tupling-basic-ntp.root:/DimuonsTuple +RFileCnv INFO opening Root file "DV-example-tupling-basic-ntp-run-mc.root" for writing +RCWNTupleCnv INFO Booked TTree with ID: DecayTree "DecayTree" in directory DV-example-tupling-basic-ntp-run-mc.root:/DimuonsTuple ApplicationMgr INFO Application Manager Stopped successfully FSROutputStreamDstWriter INFO Set up File Summary Record FSROutputStreamDstWriter INFO Events output: 1 @@ -47,7 +47,7 @@ LAZY_AND: DaVinci #=10 Sum=10 Eff=|( 100 FunTupleBase_Particles/DimuonsTuple #=10 Sum=10 Eff=|( 100.0000 +- 0.00000 )%| ToolSvc INFO Removing all tools created by ToolSvc RFileCnv INFO dumping contents of /NTUPLES/FILE1 -TFile: name=DV-example-tupling-basic-ntp.root, title=Gaudi Trees, option=CREATE +TFile: name=DV-example-tupling-basic-ntp-run-mc.root, title=Gaudi Trees, option=CREATE NTupleSvc INFO NTuples saved successfully ApplicationMgr INFO Application Manager Finalized successfully ApplicationMgr INFO Application Manager Terminated successfully diff --git a/DaVinciExamples/tests/refs/test_davinci_tupling_from_hlt2_gaudirun.ref b/DaVinciExamples/tests/refs/test_davinci_tupling_from_hlt2_gaudirun.ref index 86aebb8c..9d5f6819 100644 --- a/DaVinciExamples/tests/refs/test_davinci_tupling_from_hlt2_gaudirun.ref +++ b/DaVinciExamples/tests/refs/test_davinci_tupling_from_hlt2_gaudirun.ref @@ -8,18 +8,17 @@ ApplicationMgr SUCCESS ApplicationMgr INFO Application Manager Configured successfully DetectorPersistencySvc INFO Added successfully Conversion service:XmlCnvSvc DetectorDataSvc SUCCESS Detector description database: git:/lhcb.xml -NTupleSvc INFO Added stream file:tuple_D0_Kpi_10evts.root as FILE1 -RootHistSvc INFO Writing ROOT histograms to: tuple_D0_Kpi_10evts.root +NTupleSvc INFO Added stream file:tuple_D0_Kpi_10evts_gaudirun.root as FILE1 +RootHistSvc INFO Writing ROOT histograms to: tuple_D0_Kpi_10evts_gaudirun.root HistogramPersistencySvc INFO Added successfully Conversion service:RootHistSvc EventClockSvc.FakeEventTime INFO Event times generated from 0 with steps of 0 ApplicationMgr INFO Application Manager Initialized successfully DeFTDetector INFO Current FT geometry version = 64 ApplicationMgr INFO Application Manager Started successfully EventPersistencySvc INFO Added successfully Conversion service:RootCnvSvc -EventSelector INFO Stream:EventSelector.DataStreamTool_1 Def:DATAFILE='root://eoslhcb.cern.ch//eos/lhcb/wg/dpa/wp3/NovemberFEST/hlt2_D0_Kpi_10evts.dst' SVC='Gaudi::RootEvtSelector' OPT='READ' IgnoreChecksum='YES' EventSelector SUCCESS Reading Event record 1. Record number within stream 1: 1 -RFileCnv INFO opening Root file "tuple_D0_Kpi_10evts.root" for writing -RCWNTupleCnv INFO Booked TTree with ID: DecayTree "DecayTree" in directory tuple_D0_Kpi_10evts.root:/Tuple +RFileCnv INFO opening Root file "tuple_D0_Kpi_10evts_gaudirun.root" for writing +RCWNTupleCnv INFO Booked TTree with ID: DecayTree "DecayTree" in directory tuple_D0_Kpi_10evts_gaudirun.root:/Tuple ApplicationMgr INFO Application Manager Stopped successfully Tuple SUCCESS Booked 1 N-Tuples and 0 Event Tag Collections Tuple SUCCESS List of booked N-Tuples in directory "FILE1/Tuple" @@ -46,7 +45,7 @@ LAZY_AND: DaVinci #=7 Sum=7 FunTupleBase_Particles/Tuple #=7 Sum=7 Eff=|( 100.0000 +- 0.00000 )%| ToolSvc INFO Removing all tools created by ToolSvc RFileCnv INFO dumping contents of /NTUPLES/FILE1 -TFile: name=tuple_D0_Kpi_10evts.root, title=Gaudi Trees, option=CREATE +TFile: name=tuple_D0_Kpi_10evts_gaudirun.root, title=Gaudi Trees, option=CREATE NTupleSvc INFO NTuples saved successfully ApplicationMgr INFO Application Manager Finalized successfully ApplicationMgr INFO Application Manager Terminated successfully -- GitLab