Skip to content

Commit 732a50f

Browse files
committed
remove parralel tests
1 parent b4bc445 commit 732a50f

3 files changed

Lines changed: 0 additions & 52 deletions

File tree

queuerJob_test.go

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ func TestAddJob(t *testing.T) {
3030
testQueuer := newQueuerMock("TestQueuer", 100)
3131

3232
t.Run("Successfully adds a job with nil options", func(t *testing.T) {
33-
t.Parallel()
34-
3533
expectedJob := &model.Job{
3634
TaskName: "queuer.TaskMock",
3735
Parameters: model.Parameters{1.0, "2"},
@@ -47,8 +45,6 @@ func TestAddJob(t *testing.T) {
4745
})
4846

4947
t.Run("Returns error for nil function", func(t *testing.T) {
50-
t.Parallel()
51-
5248
var nilTask func() // Invalid nil function
5349
job, err := testQueuer.AddJob(nilTask, "param1")
5450

@@ -58,8 +54,6 @@ func TestAddJob(t *testing.T) {
5854
})
5955

6056
t.Run("Returns error for invalid task type", func(t *testing.T) {
61-
t.Parallel()
62-
6357
invalidTask := 123 // Invalid integer type instead of a function
6458
job, err := testQueuer.AddJob(invalidTask, "param1")
6559

@@ -73,8 +67,6 @@ func TestAddJobRunning(t *testing.T) {
7367
testQueuer := newQueuerMock("TestQueuer", 100)
7468

7569
t.Run("Successfully runs a job without options", func(t *testing.T) {
76-
t.Parallel()
77-
7870
job, err := testQueuer.AddJob(TaskMock, 1, "2")
7971
assert.NoError(t, err, "AddJob should not return an error on success")
8072

@@ -101,8 +93,6 @@ func TestAddJobRunning(t *testing.T) {
10193
})
10294

10395
t.Run("Successfully runs a job with options", func(t *testing.T) {
104-
t.Parallel()
105-
10696
options := &model.Options{
10797
OnError: &model.OnError{
10898
Timeout: 5,
@@ -153,8 +143,6 @@ func TestAddJobWithOptions(t *testing.T) {
153143
testQueuer := newQueuerMock("TestQueuer", 100)
154144

155145
t.Run("Successfully adds a job with options", func(t *testing.T) {
156-
t.Parallel()
157-
158146
options := &model.Options{
159147
OnError: &model.OnError{
160148
Timeout: 5,
@@ -185,8 +173,6 @@ func TestAddJobWithOptions(t *testing.T) {
185173
})
186174

187175
t.Run("Successfully adds a job with nil options", func(t *testing.T) {
188-
t.Parallel()
189-
190176
expectedJob := &model.Job{
191177
TaskName: "queuer.TaskMock",
192178
Parameters: model.Parameters{1.0, "2"},
@@ -201,8 +187,6 @@ func TestAddJobWithOptions(t *testing.T) {
201187
})
202188

203189
t.Run("Return error for invalid options", func(t *testing.T) {
204-
t.Parallel()
205-
206190
options := &model.Options{
207191
OnError: &model.OnError{
208192
Timeout: -5, // Invalid timeout
@@ -229,8 +213,6 @@ func TestAddJobs(t *testing.T) {
229213
testQueuer := newQueuerMock("TestQueuer", 100)
230214

231215
t.Run("Successfully adds multiple jobs with nil options", func(t *testing.T) {
232-
t.Parallel()
233-
234216
batchJobs := []model.BatchJob{
235217
{
236218
Task: TaskMock,
@@ -253,8 +235,6 @@ func TestAddJobs(t *testing.T) {
253235
})
254236

255237
t.Run("Returns error for invalid batch job", func(t *testing.T) {
256-
t.Parallel()
257-
258238
batchJobs := []model.BatchJob{
259239
{
260240
Task: nil, // Invalid nil function
@@ -272,8 +252,6 @@ func TestCancelJob(t *testing.T) {
272252
testQueuer := newQueuerMock("TestQueuer", 100)
273253

274254
t.Run("Successfully cancels a queued job", func(t *testing.T) {
275-
t.Parallel()
276-
277255
job, err := testQueuer.AddJob(TaskMock, 1, "2")
278256
assert.NoError(t, err, "AddJob should not return an error on success")
279257

@@ -289,8 +267,6 @@ func TestCancelJob(t *testing.T) {
289267
})
290268

291269
t.Run("Returns error for non-existent job", func(t *testing.T) {
292-
t.Parallel()
293-
294270
cancelledJob, err := testQueuer.CancelJob(uuid.New())
295271
assert.Error(t, err, "CancelJob should return an error for non-existent job")
296272
assert.Nil(t, cancelledJob, "Cancelled job should be nil for non-existent job")
@@ -301,8 +277,6 @@ func TestCancelJobRunning(t *testing.T) {
301277
testQueuer := newQueuerMock("TestQueuer", 100)
302278

303279
t.Run("Successfully cancels a running job", func(t *testing.T) {
304-
t.Parallel()
305-
306280
job, err := testQueuer.AddJob(TaskMock, 3, "2")
307281
assert.NoError(t, err, "AddJob should not return an error on success")
308282

@@ -339,8 +313,6 @@ func TestCancelAllJobsByWorkerRunning(t *testing.T) {
339313
testQueuer := newQueuerMock("TestQueuer", 100)
340314

341315
t.Run("Successfully cancels all jobs by worker RID", func(t *testing.T) {
342-
t.Parallel()
343-
344316
worker, err := testQueuer.GetWorker(testQueuer.worker.RID)
345317
require.NoError(t, err, "GetWorker should not return an error on success")
346318

@@ -388,8 +360,6 @@ func TestReaddJobFromArchive(t *testing.T) {
388360
testQueuer := newQueuerMock("TestQueuer", 100)
389361

390362
t.Run("Successfully readds a job from archive", func(t *testing.T) {
391-
t.Parallel()
392-
393363
job, err := testQueuer.AddJob(TaskMock, 1, "2")
394364
assert.NoError(t, err, "AddJob should not return an error on success")
395365

queuerTask_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ func TestAddTask(t *testing.T) {
1212
testQueuer := newQueuerMock("TestQueuer", 100)
1313

1414
t.Run("Successfully add task", func(t *testing.T) {
15-
t.Parallel()
16-
1715
task := func() {}
1816
newTask := testQueuer.AddTask(task)
1917
require.NotNil(t, newTask, "expected task to be created")
@@ -26,8 +24,6 @@ func TestAddTask(t *testing.T) {
2624
})
2725

2826
t.Run("Panics on nil task", func(t *testing.T) {
29-
t.Parallel()
30-
3127
var newTask *model.Task
3228
defer func() {
3329
r := recover()
@@ -44,8 +40,6 @@ func TestAddTaskWithName(t *testing.T) {
4440
testQueuer := newQueuerMock("TestQueuer", 100)
4541

4642
t.Run("Successfully add task with name", func(t *testing.T) {
47-
t.Parallel()
48-
4943
task := func() {}
5044
newTask := testQueuer.AddTaskWithName(task, "CustomTaskName")
5145
require.NotNil(t, newTask, "expected task to be created")
@@ -58,8 +52,6 @@ func TestAddTaskWithName(t *testing.T) {
5852
})
5953

6054
t.Run("Panics on nil task with name", func(t *testing.T) {
61-
t.Parallel()
62-
6355
var newTask *model.Task
6456
defer func() {
6557
r := recover()
@@ -72,8 +64,6 @@ func TestAddTaskWithName(t *testing.T) {
7264
})
7365

7466
t.Run("Panics on empty task name", func(t *testing.T) {
75-
t.Parallel()
76-
7767
var newTask *model.Task
7868
defer func() {
7969
r := recover()

queuerWorker_test.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,13 @@ func TestGetWorker(t *testing.T) {
1212
testQueuer := newQueuerMock("TestQueuer", 100)
1313

1414
t.Run("Successfully get worker created by the new queuer", func(t *testing.T) {
15-
t.Parallel()
16-
1715
retrievedWorker, err := testQueuer.GetWorker(testQueuer.worker.RID)
1816
assert.NoError(t, err, "expected no error when getting worker")
1917
require.NotNil(t, retrievedWorker, "expected worker to be retrieved")
2018
assert.Equal(t, testQueuer.worker.RID, retrievedWorker.RID, "expected retrieved worker RID to match the original worker RID")
2119
})
2220

2321
t.Run("Returns error for non-existent worker", func(t *testing.T) {
24-
t.Parallel()
25-
2622
nonExistentWorkerRid := uuid.New()
2723
retrievedWorker, err := testQueuer.GetWorker(nonExistentWorkerRid)
2824
assert.Error(t, err, "expected error when getting non-existent worker")
@@ -34,35 +30,27 @@ func TestGetWorkers(t *testing.T) {
3430
testQueuer := newQueuerMock("TestQueuer", 100)
3531

3632
t.Run("Successfully get workers starting from the lastId", func(t *testing.T) {
37-
t.Parallel()
38-
3933
workers, err := testQueuer.GetWorkers(0, 10)
4034
assert.NoError(t, err, "expected no error when getting workers")
4135
require.NotNil(t, workers, "expected workers to be retrieved")
4236
assert.Equal(t, len(workers), 1, "expected one worker to be retrieved")
4337
})
4438

4539
t.Run("Returns error for invalid lastId", func(t *testing.T) {
46-
t.Parallel()
47-
4840
workers, err := testQueuer.GetWorkers(-1, 10)
4941
require.Error(t, err, "expected error for invalid lastId")
5042
assert.Contains(t, err.Error(), "lastId cannot be negative, got -1", "expected error message for negative lastId")
5143
assert.Nil(t, workers, "expected no workers to be retrieved for invalid lastId")
5244
})
5345

5446
t.Run("Returns error for invalid entries", func(t *testing.T) {
55-
t.Parallel()
56-
5747
workers, err := testQueuer.GetWorkers(0, 0)
5848
require.Error(t, err, "expected error for invalid entries")
5949
assert.Contains(t, err.Error(), "entries must be greater than zero, got 0", "expected error message for zero entries")
6050
assert.Nil(t, workers, "expected no workers to be retrieved for zero entries")
6151
})
6252

6353
t.Run("Return empty slice for non existant lastId", func(t *testing.T) {
64-
t.Parallel()
65-
6654
workers, err := testQueuer.GetWorkers(1000, 10)
6755
assert.NoError(t, err, "expected no error when getting workers with non-existent lastId")
6856
require.Nil(t, workers, "expected no workers to be retrieved for non-existent lastId")

0 commit comments

Comments
 (0)