-
Notifications
You must be signed in to change notification settings - Fork 171
Make sure run_id is unique by using miliseconds instead of only seconds #12083
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
Make sure run_id is unique by using miliseconds instead of only seconds #12083
Conversation
logger.debug("Generating run_id from timestamp") | ||
run_id = int(time.time()) | ||
logger.debug("Generating run_id from timestamp and random number") | ||
run_id = int(time.time()) * 1000 + random.randint(0, 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
run_id = int(time.time()) * 1000 + random.randint(0, 1000) | |
run_id = int(time.time() * 1000) |
As time.time() returns something like:
1746544165.797612
You can make it quite easy with milliseconds included instead of using random. Then the chance we hit the same millisecond is probably impossible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR validation
Cluster Name:
Cluster Configuration:
PR Test Suite: acceptance
PR Test Path: tests/
Additional Test Params:
OCP VERSION: 4.19
OCS VERSION: 4.19
tested against branch: master
Job FAILED (installation failed, tests not executed).
Signed-off-by: Daniel Horak <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unknown PR validation
Cluster Name:
Cluster Configuration:
PR Test Suite: acceptance
PR Test Path: tests/
Additional Test Params:
OCP VERSION: 4.19
OCS VERSION: 4.19
tested against branch: master
Job state: ABORTED.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR validation
Cluster Name:
Cluster Configuration:
PR Test Suite: acceptance
PR Test Path: tests/
Additional Test Params:
OCP VERSION: 4.19
OCS VERSION: 4.19
tested against branch: master
Job FAILED (installation failed, tests not executed).
23b3e3f
to
ba0f27e
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dahorak, petr-balogh, vavuthu The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/cherry-pick release-4.18 |
@petr-balogh: new pull request created: #12089 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/cherry-pick release-4.17 |
@dahorak: #12083 failed to apply on top of branch "release-4.17":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR validation
Cluster Name:
Cluster Configuration:
PR Test Suite: acceptance
PR Test Path: tests/
Additional Test Params:
OCP VERSION: 4.19
OCS VERSION: 4.19
tested against branch: master
When the
run_id
is taken just from seconds timestamp, there is a possibility that two runs will get the samerun_id
:This situation breaks the reporting to Report Portal and might cause another issues.
To minimize this risk, we can use miliseconds as run_id.