Skip to content
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

Randomize namespace to avoid false successes #20775

Merged
merged 2 commits into from
Jan 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io.airbyte.commons.json.Jsons;
import io.airbyte.commons.lang.Exceptions;
import io.airbyte.commons.resources.MoreResources;
import io.airbyte.commons.string.Strings;
import io.airbyte.commons.util.MoreIterators;
import io.airbyte.config.EnvConfigs;
import io.airbyte.config.JobGetSpecConfig;
Expand Down Expand Up @@ -986,7 +987,10 @@ void testSyncUsesAirbyteStreamNamespaceIfNotNull() throws Exception {
Jsons.deserialize(
MoreResources.readResource(DataArgumentsProvider.EXCHANGE_RATE_CONFIG.getCatalogFileVersion(getProtocolVersion())),
AirbyteCatalog.class);
final String namespace = "sourcenamespace";
// A randomized namespace is required otherwise you can generate a "false success" with data from a
// previous run.
final String namespace = Strings.addRandomSuffix("airbyte_source_namespace", "_", 8);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have cleanup logic for these randomized datasets? Or is the plan to just add a TTL on the tables (or some other way to clean them out eventually)

(it looks like tearDownBigQuery only deletes the default dataset, so these airbyte_source_namespace_* won't get deleted)


catalog.getStreams().forEach(stream -> stream.setNamespace(namespace));
final ConfiguredAirbyteCatalog configuredCatalog = CatalogHelpers.toDefaultConfiguredCatalog(
catalog);
Expand Down