-
Notifications
You must be signed in to change notification settings - Fork 741
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 flaky test: [It] should delete job when expired time is up #1808
Conversation
Pull Request Test Coverage Report for Build 5033675281
💛 - Coveralls |
825cc27
to
cd9c3d4
Compare
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
cd9c3d4
to
e5f9e85
Compare
// We need to wait for synchronizing cache. | ||
By("getting a created TFJob") | ||
var updatedTFJob kubeflowv1.TFJob | ||
Eventually(func() error { | ||
return reconciler.Get(ctx, client.ObjectKeyFromObject(tc.tfJob), &updatedTFJob) | ||
}, timeout, interval).Should(BeNil()) |
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.
We should get the latest TFJob after creating and updating TFJobs.
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.
Good one. Is this guaranteed to have cache synchronisation and we get the latest object?
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.
// We need to wait for synchronizing cache. | |
By("getting a created TFJob") | |
var updatedTFJob kubeflowv1.TFJob | |
Eventually(func() error { | |
return reconciler.Get(ctx, client.ObjectKeyFromObject(tc.tfJob), &updatedTFJob) | |
}, timeout, interval).Should(BeNil()) | |
By("getting a created TFJob") | |
var updatedTFJob kubeflowv1.TFJob | |
Expect(reconciler.Get(ctx, client.ObjectKeyFromObject(tc.tfJob), &updatedTFJob)).Should(Succeeded()) |
Actually, I tried the above code. But I couldn't obtain any TFJob. So we must wait for synchronizing cache.
ref: 825cc27
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.
I believe that we can avoid the following error since getting TFJob after creating one.
Expected success, but got an error:
<*errors.StatusError | 0xc0019a06e0>: {
ErrStatus: {
TypeMeta: {Kind: "", APIVersion: ""},
ListMeta: {
SelfLink: "",
ResourceVersion: "",
Continue: "",
RemainingItemCount: nil,
},
Status: "Failure",
Message: "Operation cannot be fulfilled on tfjobs.kubeflow.org \"test-bof-0\": the object has been modified; please apply your changes to the latest version and try again",
Reason: "Conflict",
Details: {
Name: "test-bof-0",
Group: "kubeflow.org",
Kind: "tfjobs",
UID: "",
Causes: nil,
RetryAfterSeconds: 0,
},
Code: 409,
},
}
Thanks @tenzen-y |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: johnugeorge, tenzen-y The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
I fixed the flaky test case,
[It] should delete job when expired time is up
for TFJob.Which issue(s) this PR fixes (optional, in
Fixes #<issue number>, #<issue number>, ...
format, will close the issue(s) when PR gets merged):Fixes #1802
Checklist: