-
Notifications
You must be signed in to change notification settings - Fork 141
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
Test JDC shutdown behavior #1348
Comments
This is mainly raised because of this test https://github.com/stratum-mining/stratum/blob/main/test/message-generator/test/jds-do-not-panic-if-jdc-close-connection/jds-do-not-panic-if-jdc-close-connection.json We can migrate this test easily to ITF with the following: #[tokio::test]
async fn jds_should_not_panic_if_jdc_shutsdown() {
let (_tp, tp_addr) = start_template_provider(None).await;
let (_pool, pool_addr) = start_pool(Some(tp_addr)).await;
let (_jds, jds_addr) = start_jds(tp_addr).await;
let (jdc, jdc_addr) = start_jdc(vec![pool_addr], tp_addr, jds_addr).await;
// This shutdown behavior is not working as expected as `jdc_addr` is not available
jdc.shutdown();
let ret = tokio::net::TcpListener::bind(jdc_addr).await;
dbg!(&ret);
assert!(ret.is_ok());
let (sniffer, sniffer_addr) = start_sniffer("0".to_string(), jds_addr, false, None).await;
let (_jdc, _jdc_addr) = start_jdc(vec![pool_addr], tp_addr, sniffer_addr).await;
assert_common_message!(sniffer.next_message_from_downstream(), SetupConnection);
} |
will add this |
#1321
Introduced a
shutdown
object toJobDeclaratorClient
but add a unit test to cover its functionality.Ideally something like the following should be added as a unit test:
The text was updated successfully, but these errors were encountered: