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

integration/conftest: try to set event_loop on failure #851

Merged
merged 5 commits into from
Mar 3, 2023

Conversation

jevonyeoh
Copy link
Contributor

@jevonyeoh jevonyeoh commented Mar 3, 2023

Description

There's a bunch of errors of the form RuntimeError: There is no current event loop in thread 'Dummy-1'. that pop up once in a while on failing integration tests.

Example: https://github.com/featurebyte/featurebyte/actions/runs/4320831275/jobs/7541472752

Some googling suggests we can try to avoid this by having some extra handling around the event loop fixture.

Related links

I don't think this necessarily solves the underlying issue, but figured it might be worth a try to try to make a short-term patch to alleviate some flaky integration tests.

Related Issue

Type of Change

Label this pull request to place it under the correct category in Release Notes:

Pull Request Label Category in Release Notes
enhancement, feature 🚀 Features
bug, refactoring, bugfix, fix 🔧 Fixes & Refactoring
build, ci, testing 📦 Build System & CI/CD
breaking 💥 Breaking Changes
documentation 📝 Documentation
dependencies ⬆️ Dependencies updates

Checklist

@jevonyeoh jevonyeoh added the Skip Changelog Changelog checker skip label Mar 3, 2023
@jevonyeoh jevonyeoh changed the title [wip] integration/conftest: try run_forever [wip] integration/conftest: event_loop trying Mar 3, 2023
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

Coverage

Coverage Report
FileStmtsMissCoverMissing
featurebyte
   __init__.py310100% 
   __main__.py1201200%4–298
   app.py54197%138
   config.py143497%288, 308–309, 381
   enum.py1380100% 
   exception.py640100% 
   logger.py110100% 
   middleware.py61296%78, 118
featurebyte/api
   __init__.py00100% 
   api_object.py255896%73, 125, 415, 595, 620, 674–>676, 677, 680, 703
   base_data.py141298%60–>exit, 279–280
   change_view.py85693%97, 180–188, 255, 339
   data.py250100% 
   database_table.py102198%48–>51, 107
   dimension_data.py340100% 
   dimension_view.py530100% 
   entity.py49196%110
   event_data.py78395%104–105, 308
   event_view.py120099%66–>exit
   feature.py250596%92, 103, 331, 335, 783
   feature_job.py125397%122–123, 322
   feature_job_setting_analysis.py620100% 
   feature_list.py3901096%100, 275, 304, 340, 343, 437, 448, 645, 909, 1066, 1168–>1163, 1188–>1190
   feature_store.py54390%135, 162, 196
   feature_validation_util.py60100% 
   groupby.py226697%93, 205, 335–>exit, 418, 528, 642–>646, 672, 675
   item_data.py61098%86–>97
   item_view.py108395%148, 243, 400–>exit, 409
   lag.py220100% 
   relationship.py42686%73–74, 86–89
   scd_data.py650100% 
   scd_view.py82197%104, 244–>246
   view.py241797%78, 263–264, 307–309, 785
   window_validator.py120100% 
   workspace.py460100% 
featurebyte/api/templates
   __init__.py00100% 
featurebyte/api/templates/online_serving
   __init__.py00100% 
featurebyte/common
   __init__.py00100% 
   date_util.py29195%37
   descriptor.py160100% 
   dict_util.py60100% 
   doc_util.py80100% 
   env_util.py16195%21
   join_utils.py370100% 
   model_util.py340100% 
   path_util.py120100% 
   singleton.py9445%17–20
   tile_util.py120100% 
   typing.py180100% 
   utils.py76396%215–216, 252
   validator.py480100% 
featurebyte/core
   __init__.py00100% 
   frame.py72198%202
   generic.py106395%239–>238, 280, 287, 300
   mixin.py92493%189, 229, 294, 348
   series.py253398%169, 800, 844
   timedelta.py130100% 
   util.py27197%80
featurebyte/core/accessor
   __init__.py00100% 
   count_dict.py660100% 
   datetime.py31195%102
   string.py540100% 
featurebyte/datasets
   __init__.py00100% 
   __main__.py19190%4–26
   app.py62620%4–103
featurebyte/feature_manager
   __init__.py00100% 
   manager.py780100% 
   model.py330100% 
   sql_template.py80100% 
featurebyte/migration
   __init__.py00100% 
   migration_data_service.py60100% 
   model.py210100% 
   run.py84199%235
featurebyte/migration/service
   __init__.py180100% 
   context.py40100% 
   data_warehouse.py95990%56–59, 104, 131, 156, 165, 209–211
   dimension_data.py40100% 
   entity.py430100% 
   event_data.py20950%25–45
   feature.py170100% 
   feature_job_setting_analysis.py40100% 
   feature_list.py40100% 
   feature_list_namespace.py170100% 
   feature_namespace.py170100% 
   item_data.py40100% 
   mixin.py730100% 
   scd_data.py40100% 
featurebyte/models
   __init__.py80100% 
   base.py113496%53, 61, 138, 263
   context.py100100% 
   credential.py46196%77
   dimension_data.py26293%55–58
   entity.py280100% 
   entity_validation.py340100% 
   event_data.py29194%83
   feature.py1020100% 
   feature_job_setting_analysis.py89394%79, 81, 84
   feature_list.py199298%195, 567
   feature_store.py480100% 
   item_data.py210100% 
   online_store.py48097%101–>97, 103–>97
   parent_serving.py140100% 
   persistent.py330100% 
   relationship.py350100% 
   scd_data.py28481%71–83
   semantic.py70100% 
   tabular_data.py130100% 
   task.py220100% 
   tile.py32195%73
   workspace.py120100% 
featurebyte/persistent
   __init__.py20100% 
   audit.py62197%162, 291–>300
   base.py99298%668–669
   mongo.py70197%316, 334–>exit
featurebyte/query_graph
   __init__.py00100% 
   algorithm.py250100% 
   enum.py750100% 
   graph.py86298%312–313
   pruning_util.py110100% 
   util.py460100% 
featurebyte/query_graph/graph_node
   __init__.py00100% 
   base.py290100% 
featurebyte/query_graph/model
   __init__.py00100% 
   column_info.py90100% 
   common_table.py93197%60–>62, 74
   critical_data_info.py180100% 
   feature_job_setting.py30194%122
   graph.py193695%118, 128, 138, 301, 360–363
   table.py173895%44, 67–69, 127, 334, 405, 683
featurebyte/query_graph/node
   __init__.py100100% 
   agg_func.py58197%45
   base.py1791194%124, 144, 397–400, 428, 589–590, 649, 652
   binary.py76297%163, 166
   cleaning_operation.py89199%226
   count_dict.py981190%33, 36, 121, 124, 137, 187–190, 210–211
   date.py77692%73, 76, 107, 110, 147, 150
   generic.py5011496%399, 406–413, 654, 1038, 1040, 1047–>exit, 1202, 1205, 1272, 1275, 1298
   input.py130299%301, 304
   mixin.py67098%108–>exit, 111–>113
   nested.py153696%58, 61, 163, 534, 543, 550
   schema.py430100% 
   string.py95098%53–>55, 157–>159
   unary.py78296%136, 151
   validator.py170100% 
featurebyte/query_graph/node/metadata
   __init__.py00100% 
   column.py100100% 
   operation.py217298%138–>exit, 357–>364, 436–>exit, 456, 464
   sdk_code.py161199%119
featurebyte/query_graph/sql
   __init__.py00100% 
   adapter.py165298%491, 554
   builder.py74099%180–>187
   common.py430100% 
   dataframe.py210100% 
   expression.py290100% 
   feature_compute.py169199%141
   feature_historical.py530100% 
   feature_preview.py390100% 
   groupby_helper.py48197%68
   interpreter.py235497%250, 262–265, 267–>269, 734–>765, 824–>835
   online_serving.py1160100% 
   online_serving_util.py100100% 
   parent_serving.py380100% 
   scd_helper.py810100% 
   specs.py183099%411–>415
   template.py270100% 
   tile_compute.py1000100% 
   tile_util.py250100% 
   tiling.py1050100% 
featurebyte/query_graph/sql/aggregator
   __init__.py00100% 
   asat.py420100% 
   base.py1150100% 
   item.py340100% 
   latest.py350100% 
   lookup.py90297%86–87
   request_table.py410100% 
   window.py1390100% 
featurebyte/query_graph/sql/ast
   __init__.py00100% 
   aggregate.py600100% 
   base.py124398%110–111, 203
   binary.py330100% 
   count_dict.py790100% 
   datetime.py1190100% 
   generic.py1130100% 
   groupby.py33195%49
   input.py36195%45
   is_in.py220100% 
   join.py930100% 
   literal.py120100% 
   string.py1270100% 
   tile.py119099%229–>231, 240–>exit
   unary.py760100% 
   util.py230100% 
featurebyte/query_graph/transform
   __init__.py00100% 
   base.py250100% 
   flattening.py420100% 
   operation_structure.py450100% 
   pruning.py138099%336–>352
   reconstruction.py640100% 
   sdk_code.py51097%124–>126, 126–>128
featurebyte/routes
   __init__.py00100% 
   app_container.py410100% 
   app_container_config.py350100% 
   registry.py1010100% 
featurebyte/routes/common
   __init__.py00100% 
   base.py490100% 
   base_data.py490100% 
   schema.py120100% 
   util.py60100% 
featurebyte/routes/context
   __init__.py00100% 
   api.py350100% 
   controller.py140100% 
featurebyte/routes/dimension_data
   __init__.py00100% 
   api.py410100% 
   controller.py180100% 
featurebyte/routes/entity
   __init__.py00100% 
   api.py560100% 
   controller.py230100% 
featurebyte/routes/event_data
   __init__.py00100% 
   api.py460100% 
   controller.py200100% 
featurebyte/routes/feature
   __init__.py00100% 
   api.py540100% 
   controller.py64099%109–>115
featurebyte/routes/feature_job_setting_analysis
   __init__.py00100% 
   api.py500100% 
   controller.py410100% 
featurebyte/routes/feature_list
   __init__.py00100% 
   api.py720100% 
   controller.py96694%141–>148, 232–233, 271–277, 355–356
featurebyte/routes/feature_list_namespace
   __init__.py00100% 
   api.py35391%106–115
   controller.py340100% 
featurebyte/routes/feature_namespace
   __init__.py00100% 
   api.py35391%99–108
   controller.py310100% 
featurebyte/routes/feature_store
   __init__.py00100% 
   api.py690100% 
   controller.py65785%118–142, 167
featurebyte/routes/item_data
   __init__.py00100% 
   api.py410100% 
   controller.py180100% 
featurebyte/routes/relationship_info
   __init__.py00100% 
   api.py400100% 
   controller.py330100% 
featurebyte/routes/scd_data
   __init__.py00100% 
   api.py410100% 
   controller.py22096%36–>42
featurebyte/routes/semantic
   __init__.py00100% 
   api.py410100% 
   controller.py140100% 
featurebyte/routes/tabular_data
   __init__.py00100% 
   api.py180100% 
   controller.py70100% 
featurebyte/routes/task
   __init__.py00100% 
   api.py160100% 
   controller.py170100% 
featurebyte/routes/temp_data
   __init__.py00100% 
   api.py110100% 
   controller.py17288%49–50
featurebyte/routes/workspace
   __init__.py00100% 
   api.py460100% 
   controller.py210100% 
featurebyte/schema
   __init__.py30100% 
   context.py270100% 
   dimension_data.py140100% 
   entity.py230100% 
   event_data.py200100% 
   feature.py63198%117
   feature_job_setting_analysis.py360100% 
   feature_list.py440100% 
   feature_list_namespace.py160100% 
   feature_namespace.py280100% 
   feature_store.py490100% 
   info.py135497%135–136, 365–366
   item_data.py160100% 
   relationship_info.py280100% 
   scd_data.py220100% 
   semantic.py150100% 
   tabular_data.py38486%70–73
   task.py250100% 
   workspace.py180100% 
featurebyte/schema/common
   __init__.py00100% 
   base.py170100% 
   operation.py43197%78
featurebyte/schema/worker
   __init__.py00100% 
   progress.py60100% 
featurebyte/schema/worker/task
   __init__.py00100% 
   base.py30191%47, 51–>53
   feature_job_setting_analysis.py140100% 
   test.py80100% 
featurebyte/service
   __init__.py00100% 
   base_data_document.py53192%100–>115, 101–>111, 112, 126–>130
   base_document.py174497%181–183, 395, 467, 479–>464
   base_service.py100100% 
   context.py57099%133–>138
   data_update.py135199%321
   default_version_mode.py320100% 
   deploy.py760100% 
   dimension_data.py60100% 
   entity.py210100% 
   entity_validation.py590100% 
   event_data.py60100% 
   feature.py560100% 
   feature_job_setting_analysis.py240100% 
   feature_list.py670100% 
   feature_list_namespace.py60100% 
   feature_namespace.py60100% 
   feature_readiness.py830100% 
   feature_store.py80100% 
   feature_store_warehouse.py78099%246–>263
   info.py205199%532
   item_data.py60100% 
   mixin.py300100% 
   online_enable.py67197%162
   online_serving.py47196%78
   parent_serving.py70099%107–>exit
   preview.py144199%387
   relationship.py790100% 
   relationship_info.py50100% 
   scd_data.py90100% 
   semantic.py80100% 
   session_manager.py29194%66
   session_validator.py56394%119, 176–179
   tabular_data.py120100% 
   task_manager.py410100% 
   user_service.py60100% 
   version.py154397%124, 128, 197, 238–>189
   working_schema.py35290%36, 71
   workspace.py250100% 
featurebyte/session
   __init__.py00100% 
   base.py243696%15–16, 87, 240–>243, 266–267, 414, 661–>664
   databricks.py105989%18–19, 58, 62, 66, 72–>74, 80–>82, 92–>94, 109–>116, 173, 176–177, 183, 189–>191
   enum.py120100% 
   hive.py481853%56–79
   manager.py410100% 
   simple_storage.py612260%126–147, 150, 154, 157–158
   snowflake.py2021590%98–>100, 117–>119, 129–>131, 131–>133, 160, 247–>252, 277, 335–340, 343–348, 370
   spark.py2112186%72, 76, 108–109, 162–>164, 169–>172, 179–>181, 193–>202, 211, 229, 268, 274–275, 322–>330, 365, 441, 507–508, 511–522, 525
   sqlite.py60195%57–>59, 80, 90–>95
featurebyte/sql
   __init__.py00100% 
featurebyte/sql/spark
   __init__.py00100% 
   common.py40100% 
   tile_common.py270100% 
   tile_generate.py66492%93–95, 123
   tile_generate_entity_tracking.py400100% 
   tile_generate_schedule.py67986%55–56, 173–182
   tile_monitor.py45785%39, 123–156
   tile_registry.py52196%109–>113, 122
   tile_schedule_online_store.py500100% 
featurebyte/storage
   __init__.py40100% 
   base.py330100% 
   local.py40198%44
   local_temp.py70100% 
featurebyte/tile
   __init__.py00100% 
   base.py45876%165–178, 254–261
   databricks_tile.py45450%4–169
   scheduler.py44296%101–102
   snowflake_tile.py92395%238, 285, 414
   spark_tile.py290100% 
   sql_template.py90100% 
   tile_cache.py1900100% 
featurebyte/utils
   __init__.py00100% 
   credential.py140100% 
   messaging.py21952%34–36, 47–48, 58–61
   persistent.py110100% 
   storage.py120100% 
featurebyte/utils/snowflake
   __init__.py00100% 
   sql.py40100% 
featurebyte/worker
   __init__.py37776%29, 45–48, 51–52
   enum.py220%4–7
   process_store.py54540%4–121
   progress.py14140%4–50
   start.py220%4–6
   task_executor.py22386%56–58
featurebyte/worker/task
   __init__.py30100% 
   base.py290100% 
   feature_job_setting_analysis.py620100% 
   test_task.py12457%24–27
TOTAL1908374695% 

Tests Skipped Failures Errors Time
1867 13 💤 0 ❌ 0 🔥 9m 20s ⏱️

@jevonyeoh jevonyeoh changed the title [wip] integration/conftest: event_loop trying ntegration/conftest: try to set event_loop on failure Mar 3, 2023
@jevonyeoh jevonyeoh requested review from kchua78 and YS-L March 3, 2023 09:10
@jevonyeoh jevonyeoh changed the title ntegration/conftest: try to set event_loop on failure integration/conftest: try to set event_loop on failure Mar 3, 2023
yield loop
loop.close()
except Exception as e: # pylint: disable=broad-except
if "there is no current event loop in thread" in str(e):
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be useful to log that this happened before the extra handling just in case for troubleshooting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good, i'll add a log line!

Copy link
Contributor

@YS-L YS-L left a comment

Choose a reason for hiding this comment

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

Good findings! I saw this error before too. Would be great if this can prevent that from happening again.

@jevonyeoh jevonyeoh merged commit e16ce95 into main Mar 3, 2023
@jevonyeoh jevonyeoh deleted the jevon/tryLoop branch March 3, 2023 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Skip Changelog Changelog checker skip
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants