Repository navigation
Eliminate race conditions in mongoose_wpool_SUITE - #4602
Conversation
530bd29 to
fb49721
Compare
The max_worker_queue_len_with_two_workers test was flaky because even
if a worker is not busy and has an empty queue, a new request occupies
the queue for a short time.
As a result, a subsequent call to mongoose_wpool:cast/4 might assume
that there are more requests in the queue than expected.
The solution is to ensure {waiting, Worker} is received before moving
forward.
The test for one worker is just updated for consistency.
fb49721 to
8ca811f
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
elasticsearch_and_cassandra_28 / elasticsearch_and_cassandra_mnesia / fb49721 small_tests_27 / small_tests / fb49721 small_tests_28 / small_tests / fb49721 small_tests_28_arm64 / small_tests / fb49721 ldap_mnesia_27 / ldap_mnesia / fb49721 ldap_mnesia_28 / ldap_mnesia / fb49721 internal_mnesia_28 / internal_mnesia / fb49721 dynamic_domains_mysql_redis_28 / mysql_redis / fb49721 dynamic_domains_pgsql_mnesia_27 / pgsql_mnesia / fb49721 dynamic_domains_pgsql_mnesia_28 / pgsql_mnesia / fb49721 pgsql_cets_28 / pgsql_cets / fb49721 dynamic_domains_mssql_mnesia_28 / odbc_mssql_mnesia / fb49721 pgsql_mnesia_28 / pgsql_mnesia / fb49721 pgsql_mnesia_27 / pgsql_mnesia / fb49721 mysql_redis_28 / mysql_redis / fb49721 cockroachdb_cets_28 / cockroachdb_cets / fb49721 pubsub_SUITE:dag+last_item_cache:send_last_published_item_no_items_test{error,
{timeout_when_waiting_for_stanza,
[{escalus_client,wait_for_stanza,
[{client,
<<"alice_send_last_published_item_no_items_test_3737@localhost/res1">>,
escalus_tcp,<0.115310.0>,
[{event_manager,<0.115290.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3737">>},
{resource,<<"res1">>}],
[{event_client,
[{event_manager,<0.115290.0>},
{server,<<"localhost">>},
{username,
<<"alicE_send_last_published_item_no_items_test_3737">>},
{resource,<<"res1">>}]},
{resource,<<"res1">>},
{username,
<<"alice_send_last_published_item_no_items_test_3737">>},
{server,<<"localhost">>},
{host,<<"localhost">>},
{port,5222},
{auth,fun escalus_auth:auth_plain/2},
{wspath,undefined},
{username,
<<"alicE_send_last_published_item_no_items_test_3737">>},
{server,<<"localhost">>},
{password,<<"matygrysa">>},
{stream_id,<<"dabcfeaa05c2a8ad">>}]},
5000],
[{file,
"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_client.erl"},
{line,136}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,444}]},
{pubsub_tools,receive_and_c...pubsub_SUITE:tree+hometree_specific:can_create_node_with_existing_parent_path{error,{{badmatch,false},
[{pubsub_tools,check_response,2,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,455}]},
{pubsub_tools,receive_response,3,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,445}]},
{pubsub_tools,receive_and_check_response,4,
[{file,"/home/circleci/project/big_tests/tests/pubsub_tools.erl"},
{line,435}]},
{pubsub_SUITE,'-can_create_node_with_existing_parent_path/1-fun-0-',
1,
[{file,"/home/circleci/project/big_tests/tests/pubsub_SUITE.erl"},
{line,1830}]},
{escalus_story,story,4,
[{file,"/home/circleci/project/big_tests/_build/default/lib/escalus/src/escalus_story.erl"},
{line,75}]},
{test_server,ts_tc,3,[{file,"test_server.erl"},{line,1796}]},
{test_server,run_test_case_eval1,6,
[{file,"test_server.erl"},{line,1305}]},
{test_server,run_test_case_eval,9,
[{file,"test_server.erl"},{line,1237}]}]}}mssql_mnesia_28 / odbc_mssql_mnesia / fb49721 |
Codecov Reportâ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4602 +/- ##
==========================================
- Coverage 86.07% 86.05% -0.03%
==========================================
Files 565 565
Lines 33929 33929
==========================================
- Hits 29206 29196 -10
- Misses 4723 4733 +10 â View full report in Codecov by Sentry. ð New features to boost your workflow:
|
The
max_worker_queue_len_with_two_workerstest was flaky because even if a worker is not busy and has an empty queue, a new request occupies the queue for a short time.As a result, a subsequent call to
mongoose_wpool:cast/4might assume that there are more requests in the queue than expected.The solution is to ensure
{waiting, Worker}is received before moving forward.The test for one worker is just updated for consistency.
I checked both tests locally with a repetition of 1000x. Previously, there were 20-30 failures. Now there are none.