Skip to content
Snippets Groups Projects
Commit 3ef00eff authored by Slava Monich's avatar Slava Monich
Browse files

[unit] Call gbinder_ipc_exit() when appropriate. Fixes JB#52595

If a test calls test_binder_set_looper_enabled(fd, TRUE) to enable
processing of incoming data by the looper thread, the same thread
may get picked up by the next test and swallow the reply before the
transaction (for which the reply was intended) has been submitted.
Which may cause that next test to either fail or (if the transaction
was synchronous) block forever, stalling the build.

Calling gbinder_ipc_exit() makes sure that looper thread terminates
before the next test starts.
parent 1ce13bea
No related branches found
No related tags found
No related merge requests found
......@@ -208,6 +208,7 @@ test_dead(
gbinder_client_unref(client);
g_main_loop_unref(loop);
gbinder_ipc_exit();
}
/*==========================================================================*
......
......@@ -642,6 +642,7 @@ test_increfs(
gbinder_local_object_remove_handler(obj, id);
gbinder_local_object_unref(obj);
gbinder_ipc_unref(ipc);
gbinder_ipc_exit();
g_main_loop_unref(loop);
}
......@@ -685,6 +686,7 @@ test_decrefs(
gbinder_local_object_remove_handler(obj, id);
gbinder_local_object_unref(obj);
gbinder_ipc_unref(ipc);
gbinder_ipc_exit();
g_main_loop_unref(loop);
}
......@@ -726,6 +728,7 @@ test_acquire(
gbinder_local_object_remove_handler(obj, id);
gbinder_local_object_unref(obj);
gbinder_ipc_unref(ipc);
gbinder_ipc_exit();
g_main_loop_unref(loop);
}
......@@ -768,6 +771,7 @@ test_release(
gbinder_local_object_remove_handler(obj, id);
gbinder_local_object_unref(obj);
gbinder_ipc_unref(ipc);
gbinder_ipc_exit();
g_main_loop_unref(loop);
}
......
......@@ -128,6 +128,7 @@ test_dead(
gbinder_remote_object_remove_handler(obj, 0); /* has no effect */
gbinder_remote_object_unref(obj);
gbinder_ipc_unref(ipc);
gbinder_ipc_exit();
g_main_loop_unref(loop);
}
......
......@@ -815,6 +815,7 @@ test_death(
gbinder_servicemanager_remove_all_handlers(sm, id);
gbinder_servicemanager_unref(sm);
gbinder_ipc_unref(ipc);
gbinder_ipc_exit();
g_main_loop_unref(loop);
}
......@@ -886,6 +887,7 @@ test_reanimate(
gbinder_servicemanager_remove_all_handlers(sm, id);
gbinder_servicemanager_unref(sm);
gbinder_ipc_unref(ipc);
gbinder_ipc_exit();
g_main_loop_unref(loop);
}
......
......@@ -276,6 +276,7 @@ test_get()
servicemanager_aidl_free(smsvc);
gbinder_servicemanager_unref(sm);
gbinder_ipc_unref(ipc);
gbinder_ipc_exit();
test_binder_exit_wait();
g_main_loop_unref(loop);
}
......@@ -353,6 +354,7 @@ test_list()
servicemanager_aidl_free(smsvc);
gbinder_servicemanager_unref(sm);
gbinder_ipc_unref(ipc);
gbinder_ipc_exit();
test_binder_exit_wait();
g_strfreev(test.list);
......@@ -415,6 +417,7 @@ test_notify()
servicemanager_aidl_free(smsvc);
gbinder_servicemanager_unref(sm);
gbinder_ipc_unref(ipc);
gbinder_ipc_exit();
test_binder_exit_wait();
g_main_loop_unref(loop);
}
......
......@@ -345,6 +345,7 @@ test_present(
gbinder_ipc_unref(ipc);
test_run(&test_opt, loop);
gbinder_ipc_exit();
g_main_loop_unref(loop);
}
......@@ -474,6 +475,7 @@ test_cancel(
gbinder_ipc_unref(ipc);
test_run(&test_opt, loop);
gbinder_ipc_exit();
g_main_loop_unref(loop);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment