Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix testCSCTriggerMapping test: avoid reading invalid data e.g empty line #43269

Merged
merged 1 commit into from
Nov 17, 2023

Conversation

smuzaffar
Copy link
Contributor

@smuzaffar smuzaffar commented Nov 14, 2023

Fixes #43031

The empty or invalid lines in the mapping files were causing unit test to fail for NON-LTO build. This test was reading the following data

L30:      1       3       5       0       9       1       3       5       0       9
L31:# ================================================================================
L32:
L33:#Example of a more elaborate trigger schemes

As there was no check for empty lines (or invalid format lines) the test continued to process the L32 and has reused the i1, i2, i3, i4, i5, i6, i7, i8, i9 read from the line L30 and set i10=0 . With some debug statements, the output from the tests was

LINE:      1       3       5       0       9       1       3       5       0       9
i1-10: 1 3 5 0 9 1 3 5 0 9
LINE: # ================================================================================
LINE:
i1-10: 1 3 5 0 9 1 3 5 0 0

Local tests shows that unit test works in NONLTO IBs with this fix

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43269/37670

  • This PR adds an extra 12KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43269/37672

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @smuzaffar (Malik Shahzad Muzaffar) for master.

It involves the following packages:

  • CondFormats/CSCObjects (db, alca)

@consuegs, @cmsbuild, @perrotta, @francescobrivio, @saumyaphor4252 can you please review it and eventually sign? Thanks.
@ptcox, @rsreds, @giovanni-mocellin, @seemasharmafnal, @missirol, @yuanchao, @tocheng, @PonIlya, @mmusich this is something you requested to watch as well.
@antoniovilela, @rappoccio, @sextonkennedy you are the release manager for this.

cms-bot commands are listed here

@smuzaffar
Copy link
Contributor Author

please test

@smuzaffar
Copy link
Contributor Author

please test for CMSSW_14_0_NONLTO_X

@smuzaffar
Copy link
Contributor Author

for default (LTO based IBs) this test shows the following output

LINE:      1       3       5       0       9       1       3       5       0       9
i1-10:1 3 5 0 9 1 3 5 0 9
LINE:# ================================================================================
LINE:
i1-10:1 3 5 0 9 1 3 5 0 9
CSCTriggerMapping: ERROR, already have key = 604026112

So empty line is still getting processed but is >> i1 >> i2 >> i3 >> i4 >> i5 >> i6 >> i7 >> i8 >> i9 >> i10; was not overriding the values of i1-i10 variables that is why test was running for default IBs

@@ -22,7 +22,8 @@ void CSCTriggerMappingFromFile::fill(void) {
if (line[0] != commentFlag[0]) {
int i1, i2, i3, i4, i5, i6, i7, i8, i9, i10;
std::istringstream is(line);
is >> i1 >> i2 >> i3 >> i4 >> i5 >> i6 >> i7 >> i8 >> i9 >> i10;
if (!(is >> i1 >> i2 >> i3 >> i4 >> i5 >> i6 >> i7 >> i8 >> i9 >> i10))
continue;
Copy link
Contributor Author

@smuzaffar smuzaffar Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cms-sw/alca-l2 , should we throw an exception/LogError instead of silently ignoring the bad input?

@ptcox
Copy link
Contributor

ptcox commented Nov 14, 2023

Thanks, Shahzad. The simple trap is fine. No need to do any sophisticated error trapping. Those tests are of historical interest only (I think).

@perrotta
Copy link
Contributor

Those tests are of historical interest only (I think).

Could you please elaborate? If really those tests are not needed, then I would simply remove them, and save time to maintainers

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-01d980/35803/summary.html
COMMIT: c6fb83c
CMSSW: CMSSW_14_0_X_2023-11-14-1100/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/43269/35803/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 115 lines from the logs
  • Reco comparison results: 5 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3363028
  • DQMHistoTests: Total failures: 4
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3363002
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 214 log files, 167 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@ptcox
Copy link
Contributor

ptcox commented Nov 14, 2023

Andrea, I know of nobody having made use of those tests in at least 10 years. Mainly of course because code stabilized and is very rarely changed. With luck, over the next year, we'll find somebody to go through it all, and rationalize and otherwise clean it up.

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-01d980/35804/summary.html
COMMIT: c6fb83c
CMSSW: CMSSW_14_0_NONLTO_X_2023-11-13-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/43269/35804/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially removed 222 lines from the logs
  • Reco comparison results: 1273 differences found in the comparisons
  • DQMHistoTests: Total files compared: 50
  • DQMHistoTests: Total histograms compared: 3363028
  • DQMHistoTests: Total failures: 17134
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3345872
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 49 files compared)
  • Checked 214 log files, 167 edm output root files, 50 DQM output files
  • TriggerResults: no differences found

@perrotta
Copy link
Contributor

+1

  • Minimal fix to avoid unit test to fail in NON-LTO build

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @antoniovilela, @rappoccio, @sextonkennedy (and backports should be raised in the release meeting by the corresponding L2)

@smuzaffar
Copy link
Contributor Author

@cms-sw/orp-l2 , can you please review/sign this?

@rappoccio
Copy link
Contributor

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception of category CSCTriggerNumbering::InvalidInput in unit test testCSCTriggerMapping
5 participants