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

[py2py3] Migration at level scr/python/A/B/C - slice 6 #10277

Merged
merged 2 commits into from
Feb 16, 2021

Conversation

mapellidario
Copy link
Member

@mapellidario mapellidario commented Feb 11, 2021

Fixes #10127

Status

In development

Related PRs

Description

Run futurize and some manual changes on the first batch of src/python/A/B/C.

Use of "native-string" strategy:

  • src/python/WMCore/JobSplitting/JobFactory.py: no from bultins import str here

division:

  • src/python/WMCore/JobSplitting/ParentlessMergeBySize.py: assuming that
    self.currentJob.addResourceEstimates(jobTime = jobTime, disk = (jobSize+largestFile)/1024)
    can accept float arguments

Is it backward compatible (if not, which system it affects?)

It should be. (Any possible cause for errors will we reported here)

External dependencies / deployment changes

Requires python-future in both py2 and py3 environments.

@cmsdmwmbot

This comment has been minimized.

@cmsdmwmbot

This comment has been minimized.

@cmsdmwmbot

This comment has been minimized.

@cmsdmwmbot

This comment has been minimized.

@cmsdmwmbot

This comment has been minimized.

@cmsdmwmbot

This comment has been minimized.

@cmsdmwmbot
Copy link

Jenkins results:

  • Unit tests: succeeded
    • 9 tests deleted
  • Pylint check: failed
    • 64 warnings and errors that must be fixed
    • 7 warnings
    • 358 comments to review
  • Pylint py3k check: succeeded
    • 0 errors and warnings that should be fixed
    • 0 warnings
    • 0 comments to review
  • Pycodestyle check: succeeded
    • 586 comments to review
  • Python3 compatibility checks: succeeded

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/11206/artifact/artifacts/PullRequestReport.html

@mapellidario
Copy link
Member Author

mapellidario commented Feb 12, 2021

@amaltaro Since this slice involved src/python/WMCore/WMBS/Job.py, I run some unit tests in my oracle setup. This PR seems consistent with master, so far so good.

However, I noticed that the test

nosetests test/python/WMCore_t/WMBS_t/Job_t.py:JobTest.testSaveTransaction

is ok with mariadb but fails in oracle since at least 1.3.0. Is this to be expected?

logs

With code

        testJobA = self.createTestJob()
        ... # (changes to testJobA)
        testJobA.save()
        testJobB = Job(id=testJobA["id"])
        testJobB.loadData()
        assert testJobA["mask"] == testJobB["mask"], \
            "ERROR: Job mask did not load properly" # this assertion pass in both oracle and mariadb
        ... # (otherr changes to testJobA)
        testJobA.save()
        testJobC = Job(id=testJobA["id"])
        testJobC.loadData()

        print("testJobA: ", testJobA["mask"])
        print("testJobC: ", testJobC["mask"])
        assert testJobA["mask"] == testJobC["mask"], \
            "ERROR: Job mask did not load properly"

logs from mariadb setup (apart the int becoming long, these are identical and pass the assertion)

('testJobA: ', {'LastRun': 12, 'FirstRun': 11, 'inclusivemask': True, 'runAndLumis': {}, 'LastEvent': 8, 'FirstEvent': 7, 'LastLumi': 10, 'FirstLumi': 9})
('testJobC: ', {'LastRun': 12L, 'FirstRun': 11L, 'inclusivemask': True, 'runAndLumis': {}, 'LastEvent': 8L, 'FirstEvent': 7L, 'LastLumi': 10L, 'FirstLumi': 9L})

while, logs from oracle setup are

('testJobA: ', {'LastRun': 12, 'FirstRun': 11, 'inclusivemask': True, 'runAndLumis': {}, 'LastEvent': 8, 'FirstEvent': 7, 'LastLumi': 10, 'FirstLumi': 9})
('testJobC: ', {'LastRun': 6, 'FirstRun': 5, 'inclusivemask': True, 'runAndLumis': {}, 'LastEvent': 2, 'FirstEvent': 1, 'LastLumi': 4, 'FirstLumi': 3})

as if the second save does not behave. Do you need some more logs?

@amaltaro
Copy link
Contributor

@mapellidario about the testSaveTransaction unit test:
#8372

So, I have no clue of what happens, but it seems to be somehow expected :-)

Copy link
Contributor

@amaltaro amaltaro left a comment

Choose a reason for hiding this comment

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

Changes look good Dario. Unless you have anything else to add here, I'll merge it tomorrow first thing in the morning.

@mapellidario
Copy link
Member Author

Perfect! I consider this finished and ready to merge! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
py2py3 slice Issue related to slicing the modernization to py2py3 Python3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[py2py3] Migration at level scr/python/A/B/C - slice 6
3 participants