Skip to content

Use temporary directory in tests with same output file

Patrick Koppenburg requested to merge pkoppenb-TempDir into master

We are seeing test failures (e.g. test_davinci_tupling_from_hlt2_with_matching with cause

Error in <TFile::ReadBuffer>: error reading all requested bytes from file Raw_DV_Ks_example.root, got 272 of 300
Error in <TFile::Init>: Raw_DV_Ks_example.root failed to read the file type data.

although the DaVinci job ran well.

The test runs fine locally.

I suspect that the problem is that two tests https://gitlab.cern.ch/lhcb/DaVinci/-/blob/master/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_hlt2_with_matching.py and https://gitlab.cern.ch/lhcb/DaVinci/-/blob/master/DaVinciExamples/python/DaVinciExamples/tupling/option_davinci_tupling_from_raw_data.py both use https://gitlab.cern.ch/lhcb/DaVinci/-/blob/master/DaVinciExamples/example_data/Spruce_Run251342.yaml that defines

ntuple_file: "Spruce_DV_Ks_example.root"

Indeed when I run both tests simultaneously locally I get an error.

So it could be that both tests try to write to the same file at the same time. I try adding

<argument name="use_temp_dir"><enumeral>true</enumeral></argument>

Merge request reports