When using immadm command to change saLogStreamSeverityFilter attribute in
runtime object, the adminOperationCallback is called to update the attribute
value to imm then  send the filter callback to user. sometimes the return of
command immadm come before the filter callback. if user poll the event
and dispatch all callbacks callback immediately after return immadm, the
missing callback may happen.

This patch does SLEEP 1 second in test case before starting poll callback 
 src/log/apitest/tet_saLogFilterSetCallbackT.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/log/apitest/tet_saLogFilterSetCallbackT.c 
index 5c0408e35..448430d4e 100644
--- a/src/log/apitest/tet_saLogFilterSetCallbackT.c
+++ b/src/log/apitest/tet_saLogFilterSetCallbackT.c
@@ -238,7 +238,6 @@ void saLogFilterSetCallbackT_03(void)
                test_validate(ret, 0);
                goto done;
-       sleep(1);
            "immadm -o 1 -p saLogStreamSeverityFilter:SA_UINT32_T:%d %s 2> 
@@ -248,6 +247,8 @@ void saLogFilterSetCallbackT_03(void)
                test_validate(ret, 0);
                goto done;
+       // Wait for all filter callbacks come to agent
+       osaf_nanosleep(&kOneSecond);
        fds[0].fd = (int)selectionObject;
        fds[0].events = POLLIN;

Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Opensaf-devel mailing list

Reply via email to