20
20
import io .airbyte .config .JobSyncConfig .NamespaceDefinitionType ;
21
21
import io .airbyte .config .OperatorNormalization ;
22
22
import io .airbyte .config .OperatorNormalization .Option ;
23
+ import io .airbyte .config .ResourceRequirements ;
23
24
import io .airbyte .config .SourceConnection ;
24
25
import io .airbyte .config .StandardSync ;
25
26
import io .airbyte .config .StandardSyncOperation ;
@@ -55,6 +56,7 @@ public class DefaultJobCreatorTest {
55
56
private JobPersistence jobPersistence ;
56
57
private ConfigRepository configRepository ;
57
58
private JobCreator jobCreator ;
59
+ private ResourceRequirements workerResourceRequirements ;
58
60
59
61
static {
60
62
final UUID workspaceId = UUID .randomUUID ();
@@ -114,7 +116,12 @@ public class DefaultJobCreatorTest {
114
116
void setup () {
115
117
jobPersistence = mock (JobPersistence .class );
116
118
configRepository = mock (ConfigRepository .class );
117
- jobCreator = new DefaultJobCreator (jobPersistence , configRepository );
119
+ workerResourceRequirements = new ResourceRequirements ()
120
+ .withCpuLimit ("0.2" )
121
+ .withCpuRequest ("0.2" )
122
+ .withMemoryLimit ("200Mi" )
123
+ .withMemoryRequest ("200Mi" );
124
+ jobCreator = new DefaultJobCreator (jobPersistence , configRepository , workerResourceRequirements );
118
125
}
119
126
120
127
@ Test
@@ -128,7 +135,8 @@ void testCreateSyncJob() throws IOException {
128
135
.withDestinationConfiguration (DESTINATION_CONNECTION .getConfiguration ())
129
136
.withDestinationDockerImage (DESTINATION_IMAGE_NAME )
130
137
.withConfiguredAirbyteCatalog (STANDARD_SYNC .getCatalog ())
131
- .withOperationSequence (List .of (STANDARD_SYNC_OPERATION ));
138
+ .withOperationSequence (List .of (STANDARD_SYNC_OPERATION ))
139
+ .withResourceRequirements (workerResourceRequirements );
132
140
133
141
final JobConfig jobConfig = new JobConfig ()
134
142
.withConfigType (JobConfig .ConfigType .SYNC )
@@ -158,7 +166,8 @@ void testCreateSyncJobEnsureNoQueuing() throws IOException {
158
166
.withDestinationConfiguration (DESTINATION_CONNECTION .getConfiguration ())
159
167
.withDestinationDockerImage (DESTINATION_IMAGE_NAME )
160
168
.withConfiguredAirbyteCatalog (STANDARD_SYNC .getCatalog ())
161
- .withOperationSequence (List .of (STANDARD_SYNC_OPERATION ));
169
+ .withOperationSequence (List .of (STANDARD_SYNC_OPERATION ))
170
+ .withResourceRequirements (workerResourceRequirements );
162
171
163
172
final JobConfig jobConfig = new JobConfig ()
164
173
.withConfigType (JobConfig .ConfigType .SYNC )
@@ -192,7 +201,8 @@ void testCreateResetConnectionJob() throws IOException {
192
201
.withDestinationConfiguration (DESTINATION_CONNECTION .getConfiguration ())
193
202
.withDestinationDockerImage (DESTINATION_IMAGE_NAME )
194
203
.withConfiguredAirbyteCatalog (expectedCatalog )
195
- .withOperationSequence (List .of (STANDARD_SYNC_OPERATION ));
204
+ .withOperationSequence (List .of (STANDARD_SYNC_OPERATION ))
205
+ .withResourceRequirements (workerResourceRequirements );
196
206
197
207
final JobConfig jobConfig = new JobConfig ()
198
208
.withConfigType (ConfigType .RESET_CONNECTION )
@@ -225,7 +235,8 @@ void testCreateResetConnectionJobEnsureNoQueuing() throws IOException {
225
235
.withDestinationConfiguration (DESTINATION_CONNECTION .getConfiguration ())
226
236
.withDestinationDockerImage (DESTINATION_IMAGE_NAME )
227
237
.withConfiguredAirbyteCatalog (expectedCatalog )
228
- .withOperationSequence (List .of (STANDARD_SYNC_OPERATION ));
238
+ .withOperationSequence (List .of (STANDARD_SYNC_OPERATION ))
239
+ .withResourceRequirements (workerResourceRequirements );
229
240
230
241
final JobConfig jobConfig = new JobConfig ()
231
242
.withConfigType (ConfigType .RESET_CONNECTION )
0 commit comments