-
Notifications
You must be signed in to change notification settings - Fork 86
Fix flakiness of tests #1150
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
base: main
Are you sure you want to change the base?
Fix flakiness of tests #1150
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -73,6 +73,7 @@ async def test_regression_soft_delete_schemas_should_be_registered( | |
| config.admin_metadata_max_age = 2 | ||
| config.group_id = group_id | ||
| config.topic_name = topic_name | ||
| config.producer_acks = 1 | ||
|
|
||
| master_coordinator = MasterCoordinator(config=config) | ||
| master_coordinator.set_stoppper(AlwaysAvailableSchemaReaderStoppper()) | ||
|
|
@@ -113,10 +114,10 @@ async def test_regression_soft_delete_schemas_should_be_registered( | |
| value=json_encode(value, binary=True), | ||
| ) | ||
| producer.flush() | ||
| msg = future.result() | ||
|
|
||
| schema_reader._offset_watcher.wait_for_offset(msg.offset(), timeout=5) | ||
| msg = future.result(timeout=2) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add some justification for this to the commit message, I have no idea why we would add a timeout here, as we are flushing right before. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, don't have a hard reason for this , but generally I think it is resource intensive sometimes. |
||
|
|
||
| seen = schema_reader._offset_watcher.wait_for_offset(msg.offset(), timeout=5) | ||
| assert seen is True | ||
| schemas = database.find_subject_schemas(subject=Subject(subject), include_deleted=True) | ||
| assert len(schemas) == 1, "Deleted schemas must have been registered" | ||
|
|
||
|
|
@@ -141,7 +142,7 @@ async def test_regression_soft_delete_schemas_should_be_registered( | |
| value=json_encode(value, binary=True), | ||
| ) | ||
| producer.flush() | ||
| msg = future.result() | ||
| msg = future.result(timeout=2) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here, we have flushed, waiting should not change anything. Have we actually observed something that would hint at this solving a problem we have? (I.e., I think this would raise if the future is not complete when calling |
||
|
|
||
| seen = schema_reader._offset_watcher.wait_for_offset(msg.offset(), timeout=5) | ||
| assert seen is True | ||
|
|
@@ -166,6 +167,7 @@ async def test_regression_config_for_inexisting_object_should_not_throw( | |
| config.bootstrap_uri = kafka_servers.bootstrap_servers[0] | ||
| config.admin_metadata_max_age = 2 | ||
| config.group_id = group_id | ||
| config.producer_acks = 1 | ||
|
|
||
| master_coordinator = MasterCoordinator(config=config) | ||
| master_coordinator.set_stoppper(AlwaysAvailableSchemaReaderStoppper()) | ||
|
|
@@ -200,10 +202,10 @@ async def test_regression_config_for_inexisting_object_should_not_throw( | |
| value=json_encode(value, binary=True), | ||
| ) | ||
| producer.flush() | ||
| msg = future.result() | ||
| msg = future.result(timeout=2) | ||
|
Comment on lines
-203
to
+205
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
|
|
||
| schema_reader._offset_watcher.wait_for_offset(msg.offset(), timeout=5) | ||
|
|
||
| seen = schema_reader._offset_watcher.wait_for_offset(msg.offset(), timeout=5) | ||
| assert seen is True | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we stop asserting here? |
||
| assert ( | ||
| database.find_subject(subject=Subject(subject)) is not None | ||
| ), "The above message should be handled gracefully" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add reasoning in commit message, why this change?