Skip to content

Commit

Permalink
Reduce Overtesting: Remove Reset tests. (#12078)
Browse files Browse the repository at this point in the history
The connection manager workflow already tests this case, and runs in 1 second, instead of the ~ 1 min this test case takes to run.

See: https://github.com/airbytehq/airbyte-platform-internal/blob/master/oss/airbyte-workers/src/test/java/io/airbyte/workers/temporal/scheduling/ConnectionManagerWorkflowTest.java#L853
  • Loading branch information
davinchia committed Apr 11, 2024
1 parent 58a7969 commit 5e0853a
Showing 1 changed file with 0 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,56 +487,6 @@ void testResetConnectionRepairsWorkflowWhenWorkflowUnreachable() throws Exceptio
assertEquals(JobConfigType.RESET_CONNECTION, jobInfoRead.getJob().getConfigType());
}

@Test
void testResetCancelsRunningSync() throws Exception {
final SourceDefinitionRead sourceDefinition = testHarness.createE2eSourceDefinition(
workspaceId);

final SourceRead source = testHarness.createSource(
E2E_TEST_SOURCE + UUID.randomUUID(),
workspaceId,
sourceDefinition.getSourceDefinitionId(),
Jsons.jsonNode(ImmutableMap.builder()
.put(TYPE, INFINITE_FEED)
.put(MESSAGE_INTERVAL, 1000)
.put(MAX_RECORDS, Duration.ofMinutes(5).toSeconds())
.build()));

final UUID sourceId = source.getSourceId();
final UUID destinationId = testHarness.createPostgresDestination().getDestinationId();
final SourceDiscoverSchemaRead discoverResult = testHarness.discoverSourceSchemaWithId(sourceId);
final AirbyteCatalog catalog = discoverResult.getCatalog();
final SyncMode srcSyncMode = SyncMode.FULL_REFRESH;
final DestinationSyncMode dstSyncMode = DestinationSyncMode.OVERWRITE;
catalog.getStreams().forEach(s -> s.getConfig().syncMode(srcSyncMode).selected(true).destinationSyncMode(dstSyncMode));
final UUID connectionId =
testHarness.createConnection(new TestConnectionCreate.Builder(
sourceId,
destinationId,
catalog,
discoverResult.getCatalogId())
.build())
.getConnectionId();
final JobInfoRead connectionSyncRead = testHarness.syncConnection(connectionId);

// wait to get out of PENDING
final JobRead jobRead = testHarness.waitWhileJobHasStatus(connectionSyncRead.getJob(), Set.of(JobStatus.PENDING));
assertEquals(JobStatus.RUNNING, jobRead.getStatus());

// send reset request while sync is still running
final JobInfoRead jobInfoRead = testHarness.resetConnection(connectionId);

// verify that sync job was cancelled
final JobRead connectionSyncReadAfterReset = testHarness.getJobInfoRead(connectionSyncRead.getJob().getId()).getJob();
assertEquals(JobStatus.CANCELLED, connectionSyncReadAfterReset.getStatus());

// wait for the reset to complete
testHarness.waitForSuccessfulJob(jobInfoRead.getJob());
// TODO enable once stream status for resets has been fixed
// testHarness.assertStreamStatuses(workspaceId, connectionId, StreamStatusRunState.COMPLETE,
// StreamStatusJobType.RESET);
}

// TODO (Angel): Enable once we fix the docker compose tests
@Test
@EnabledIfEnvironmentVariable(named = KUBE,
Expand Down

0 comments on commit 5e0853a

Please sign in to comment.