-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bc4c7c6
commit cdf2dce
Showing
15 changed files
with
1,046 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import logging | ||
|
||
import pytest | ||
from datahub.emitter.mce_builder import make_dataset_urn | ||
|
||
from tests.utilities.concurrent_openapi import run_tests | ||
from tests.utils import delete_urns, wait_for_writes_to_sync | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
generated_urns = [make_dataset_urn("test", f"database_test_{i}") for i in range(0, 100)] | ||
|
||
|
||
@pytest.fixture(scope="module") | ||
def ingest_cleanup_data(graph_client, request): | ||
print("removing test data before") | ||
delete_urns(graph_client, generated_urns) | ||
wait_for_writes_to_sync() | ||
yield | ||
print("removing test data after") | ||
delete_urns(graph_client, generated_urns) | ||
wait_for_writes_to_sync() | ||
|
||
|
||
def test_mysql_deadlock_gap_locking(auth_session, ingest_cleanup_data): | ||
# This generates concurrent batches with interleaved urn ids | ||
run_tests( | ||
auth_session, | ||
fixture_globs=["tests/database/v3/mysql_gap_deadlock/*.json"], | ||
num_workers=8, | ||
) |
115 changes: 115 additions & 0 deletions
115
smoke-test/tests/database/v3/mysql_gap_deadlock/batchA1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
[{ | ||
"request": { | ||
"url": "/openapi/v3/entity/dataset", | ||
"params": { | ||
"async": "false" | ||
}, | ||
"description": "Create dataset batch, single transaction", | ||
"json": [ | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_0,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_4,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_8,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_12,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_16,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_20,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_24,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_28,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_32,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_36,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_40,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_44,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_48,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}] |
107 changes: 107 additions & 0 deletions
107
smoke-test/tests/database/v3/mysql_gap_deadlock/batchA2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
[{ | ||
"request": { | ||
"url": "/openapi/v3/entity/dataset", | ||
"params": { | ||
"async": "false" | ||
}, | ||
"description": "Create dataset batch, single transaction", | ||
"json": [ | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_52,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_56,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_60,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_64,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_68,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_72,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_76,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_80,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_84,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_88,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_92,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
}, | ||
{ | ||
"urn": "urn:li:dataset:(urn:li:dataPlatform:test,database_test_96,PROD)", | ||
"status": { | ||
"value": { | ||
"removed": false | ||
} | ||
} | ||
} | ||
] | ||
} | ||
}] |
Oops, something went wrong.