Address further code review comment regarding JobExists method
This commit is contained in:
parent
b26290d922
commit
7b73930ce5
2 changed files with 19 additions and 9 deletions
|
@ -1467,10 +1467,15 @@ func TestRealisClient_JobExists(t *testing.T) {
|
|||
Tier("preemptible").
|
||||
Priority(0)
|
||||
|
||||
err := r.CreateJob(job)
|
||||
// Check if job exists before creating
|
||||
exists, err := r.JobExists(job.JobKey())
|
||||
assert.NoError(t, err)
|
||||
assert.False(t, exists)
|
||||
|
||||
err = r.CreateJob(job)
|
||||
assert.NoError(t, err)
|
||||
|
||||
exists, err := r.JobExists(job.JobKey())
|
||||
exists, err = r.JobExists(job.JobKey())
|
||||
assert.NoError(t, err)
|
||||
assert.True(t, exists)
|
||||
|
||||
|
@ -1486,6 +1491,11 @@ func TestRealisClient_JobExists(t *testing.T) {
|
|||
Disk(10).
|
||||
InstanceCount(1)
|
||||
|
||||
// Check if job exists before creating
|
||||
exists, err = r.JobExists(badJob.JobKey())
|
||||
assert.NoError(t, err)
|
||||
assert.False(t, exists)
|
||||
|
||||
err = r.CreateJob(badJob)
|
||||
assert.Error(t, err)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue