-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42384 from wddgit/fixErrorReturnCode125X
Fix error code on fallback file open error with test, 12_5_X backport
- Loading branch information
Showing
8 changed files
with
98 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
IOPool/Input/test/sitelocalconfig/noFallbackFile/local/storage.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{ "site": "DUMMY", | ||
"volume": "DummyVolume", | ||
"protocols": [ | ||
{ "protocol": "protocolThatDoesNotExist", | ||
"prefix": "abc" | ||
} | ||
] | ||
} | ||
] |
7 changes: 7 additions & 0 deletions
7
IOPool/Input/test/sitelocalconfig/noFallbackFile/site-local-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<site-local-config> | ||
<site name="DUMMY"> | ||
<data-access> | ||
<catalog volume="DummyVolume" protocol="protocolThatDoesNotExist"/> | ||
</data-access> | ||
</site> | ||
</site-local-config> |
18 changes: 18 additions & 0 deletions
18
IOPool/Input/test/sitelocalconfig/useFallbackFile/local/storage.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[ | ||
{ "site": "DUMMY", | ||
"volume": "DummyVolume1", | ||
"protocols": [ | ||
{ "protocol": "protocolThatDoesNotExist1", | ||
"prefix": "abc" | ||
} | ||
] | ||
}, | ||
{ "site": "DUMMY", | ||
"volume": "DummyVolume2", | ||
"protocols": [ | ||
{ "protocol": "protocolThatDoesNotExist2", | ||
"prefix": "abc" | ||
} | ||
] | ||
} | ||
] |
8 changes: 8 additions & 0 deletions
8
IOPool/Input/test/sitelocalconfig/useFallbackFile/site-local-config.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<site-local-config> | ||
<site name="DUMMY"> | ||
<data-access> | ||
<catalog volume="DummyVolume1" protocol="protocolThatDoesNotExist1"/> | ||
<catalog volume="DummyVolume2" protocol="protocolThatDoesNotExist2"/> | ||
</data-access> | ||
</site> | ||
</site-local-config> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
# Pass in name and status | ||
function die { echo $1: status $2 ; exit $2; } | ||
|
||
mkdir -p SITECONF | ||
mkdir -p SITECONF/local | ||
mkdir -p SITECONF/local/JobConfig | ||
|
||
export SITECONFIG_PATH=${PWD}/SITECONF/local | ||
LOCAL_TEST_DIR=${SCRAM_TEST_PATH} | ||
|
||
cp ${LOCAL_TEST_DIR}/sitelocalconfig/noFallbackFile/site-local-config.xml ${SITECONFIG_PATH}/JobConfig/ | ||
cp ${LOCAL_TEST_DIR}/sitelocalconfig/noFallbackFile/local/storage.json ${SITECONFIG_PATH}/ | ||
F1=${LOCAL_TEST_DIR}/test_fileOpenErrorExitCode_cfg.py | ||
cmsRun -j NoFallbackFile_jobreport.xml $F1 -- --input FileThatDoesNotExist.root && die "$F1 should have failed but didn't, exit code was 0" 1 | ||
|
||
CMSRUN_EXIT_CODE=$(edmFjrDump --exitCode NoFallbackFile_jobreport.xml) | ||
echo "Exit code after first run of test_fileOpenErrorExitCode_cfg.py is ${CMSRUN_EXIT_CODE}" | ||
if [ "x${CMSRUN_EXIT_CODE}" != "x8020" ]; then | ||
echo "Unexpected cmsRun exit code after FileOpenError, exit code from jobReport ${CMSRUN_EXIT_CODE} which is different from the expected 8020" | ||
exit 1 | ||
fi | ||
|
||
cp ${LOCAL_TEST_DIR}/sitelocalconfig/useFallbackFile/site-local-config.xml ${SITECONFIG_PATH}/JobConfig/ | ||
cp ${LOCAL_TEST_DIR}/sitelocalconfig/useFallbackFile/local/storage.json ${SITECONFIG_PATH}/ | ||
cmsRun -j UseFallbackFile_jobreport.xml $F1 -- --input FileThatDoesNotExist.root && die "$F1 should have failed after file fallback but didn\'t, exit code was 0" 1 | ||
|
||
CMSRUN_EXIT_CODE=$(edmFjrDump --exitCode UseFallbackFile_jobreport.xml) | ||
echo "Exit code after second run of test_fileOpenErrorExitCode_cfg.py is ${CMSRUN_EXIT_CODE}" | ||
if [ "x${CMSRUN_EXIT_CODE}" != "x8028" ]; then | ||
echo "Unexpected cmsRun exit code after FallbackFileOpenError, exit code from jobReport ${CMSRUN_EXIT_CODE} which is different from the expected 8028" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser(prog=sys.argv[0], description="Test FileOpenErrorExitCode") | ||
parser.add_argument("--input", type=str, default=[], nargs="*", help="Optional list of input files") | ||
|
||
argv = sys.argv[:] | ||
if '--' in argv: | ||
argv.remove("--") | ||
args, unknown = parser.parse_known_args(argv) | ||
|
||
process = cms.Process("TEST") | ||
|
||
process.source = cms.Source("PoolSource", | ||
fileNames = cms.untracked.vstring("/store/"+x for x in args.input) | ||
) |