HEP-FCC / FCCAnalyses

Common analysis framework for the Future Circular Collider
https://hep-fcc.github.io/FCCAnalyses/
24 stars 117 forks source link

Running tests in parallel #317

Closed kjvbrt closed 10 months ago

kjvbrt commented 1 year ago

Set up the test subcommand in a way that it runs the tests in parallel.

jmcarcell commented 11 months ago

Probably related to this, sometimes I get issues. This is one example that can be obtained simply by cloning, building and running the tests in parallel:

$ ctest -j 8 --output-on-failure --progress
Test project /fccanalyses/build
33/38 Test  #3: FCCAnalysis_analysis_example_run_analysis...................................***Failed   14.55 sec
----> INFO: Loading analyzers from libFCCAnalyses...
----> INFO: Loading analysis file:
            /fccanalyses/case-studies/analysis_example/scripts/analysis_example.py
----> INFO: No multithreading enabled. Running in single thread...
----> INFO: Load cxx analyzers from analysis_example...
----> INFO: Running over test file...
Warning in <TClass::Init>: no dictionary for class edm4hep::RecoParticleRefData is available
----> INFO: Creating dataframe object from files:
                - root://eospublic.cern.ch//eos/experiment/fcc/ee/generation/DelphesEvents/spring2021/IDEA/p8_ee_ZH_ecm240/events_101027117.root    

----> INFO: Number of local events: 100
----> INFO: Output file path:
            ./output.root
Error in <TFile::ReadBuffer>: error reading all requested bytes from file ./output.root, got 222 of 300
Error in <TFile::Init>: ./output.root failed to read the file type data.
Traceback (most recent call last):
  File "/fccanalyses/bin/fccanalysis", line 96, in <module>
    main()
  File "/fccanalyses/bin/fccanalysis", line 92, in main
    run(parser)
  File "/fccanalyses/python/FCCAnalysisRun.py", line 1155, in run
    runStages(args, rdfModule, args.preprocess, analysisFile)
  File "/fccanalyses/python/FCCAnalysisRun.py", line 483, in runStages
    runLocal(rdfModule, [testfile_path], args)
  File "/fccanalyses/python/FCCAnalysisRun.py", line 407, in runLocal
    outfile = ROOT.TFile(outfile_path, 'update')
  File "/cvmfs/sw-nightlies.hsf.org/key4hep/releases/2023-11-30/x86_64-almalinux9-gcc11.3.1-opt/root/6.28.06-jyeca4/lib/root/ROOT/_pythonization/_tfile.py", line 90, in _TFileConstructor
    raise OSError('Failed to open file {}'.format(args[0]))
OSError: Failed to open file ./output.root

It doesn't always happen

kjvbrt commented 10 months ago

https://github.com/HEP-FCC/FCCAnalyses/pull/325 should fix the issue.