Skip to content

Commit

Permalink
Merge branch 'ddavydov/#238-alphabeta-source-marketo-OOM' of github.c…
Browse files Browse the repository at this point in the history
…om:airbytehq/airbyte into ddavydov/#238-alphabeta-source-marketo-OOM
  • Loading branch information
davydov-d committed Sep 30, 2022
2 parents e4a79e0 + 435ee30 commit 0ab6361
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@
- name: Marketo
sourceDefinitionId: 9e0556f4-69df-4522-a3fb-03264d36b348
dockerRepository: airbyte/source-marketo
dockerImageTag: 0.1.9
dockerImageTag: 0.1.10
documentationUrl: https://docs.airbyte.io/integrations/sources/marketo
icon: marketo.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6046,7 +6046,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-marketo:0.1.9"
- dockerImage: "airbyte/source-marketo:0.1.10"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/marketo"
connectionSpecification:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os.path
import sys
import time

import pendulum
import pytest
from source_marketo.source import Activities, MarketoAuthenticator
Expand Down Expand Up @@ -73,12 +74,11 @@ def _generator(min_size: int):
def fake_records_gen():
new_line = "\n"
for i in range(1000):
yield f"{str(faker.random_int())},{faker.random_int()},{faker.date_of_birth()},{faker.random_int()}," \
f"{faker.random_int()},{faker.email()},{faker.postcode()}{new_line}"
yield f"{str(faker.random_int())},{faker.random_int()},{faker.date_of_birth()},{faker.random_int()}," f"{faker.random_int()},{faker.email()},{faker.postcode()}{new_line}"

size, records = 0, 0
path = os.path.realpath(str(time.time()))
with open(path, 'w') as output:
with open(path, "w") as output:
output.write("marketoGUID,leadId,activityDate,activityTypeId,campaignId,primaryAttributeValueId,primaryAttributeValue\n")
while size < min_size:
frg = fake_records_gen()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
# Copyright (c) 2022 Airbyte, Inc., all rights reserved.
#

import os
import logging
import os
import tracemalloc
from unittest.mock import ANY, Mock, patch
from functools import partial
from unittest.mock import ANY, Mock, patch

import pytest
from airbyte_cdk.models.airbyte_protocol import SyncMode
from source_marketo.source import Activities, Campaigns, MarketoStream, Programs, SourceMarketo
Expand Down Expand Up @@ -131,7 +132,7 @@ def iter_lines(*args, **kwargs):


def test_memory_usage(send_email_stream, file_generator):
min_file_size = 5 * (1024 ** 2) # 5 MB
min_file_size = 5 * (1024**2) # 5 MB
big_file_path, records_generated = file_generator(min_size=min_file_size)
small_file_path, _ = file_generator(min_size=1)

Expand Down

0 comments on commit 0ab6361

Please sign in to comment.