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

Update DBConnector definition in mock_dbconnector.cpp #1362

Closed
wants to merge 3 commits into from

Conversation

judyjoseph
Copy link
Contributor

What I did
Added the additional "namespace" argument for the DBConnector constructor in mock_dbconnector.cpp

Why I did it
The DBConnector class in the sonic-swss-common was enhanced to take the namespace argument to talk to the DB in a particular namespace. Updating the definition of DBConnector constructor here in mock_dbconnector.cpp as well.

How I verified it

Details if related

pavel-shirshov
pavel-shirshov previously approved these changes Jul 24, 2020
qiluo-msft
qiluo-msft previously approved these changes Jul 25, 2020
@judyjoseph
Copy link
Contributor Author

retest this please

1 similar comment
@judyjoseph
Copy link
Contributor Author

retest this please

@judyjoseph
Copy link
Contributor Author

retest this please

@judyjoseph judyjoseph force-pushed the swss-test-break-fix branch from 1b771d6 to 8a5e20b Compare August 11, 2020 05:49
@judyjoseph
Copy link
Contributor Author

retest this please

@judyjoseph judyjoseph marked this pull request as ready for review August 11, 2020 15:06
@judyjoseph
Copy link
Contributor Author

judyjoseph commented Aug 11, 2020

I did VS build locally in my workspace, with PR sonic-net/sonic-swss-common#371 + this PR. it worked fine.. as below

make[3]: Entering directory '/sonic/src/sonic-swss/tests/mock_tests'
make[4]: Entering directory '/sonic/src/sonic-swss/tests/mock_tests'
PASS: tests
============================================================================
Testsuite summary for sonic-swss 1.0
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0

Looking into why it is failing here in the PR build

@judyjoseph
Copy link
Contributor Author

retest this please

1 similar comment
@judyjoseph
Copy link
Contributor Author

retest this please

@daall
Copy link
Contributor

daall commented Aug 11, 2020

looks like the issue is on line 81 (see frame 6):

Running main() from /usr/src/gtest/src/gtest_main.cc
[==========] Running 21 tests from 5 test cases.
[----------] Global test environment set-up.
[----------] 1 test from AclTest
[ RUN      ] AclTest.Create_L3_Acl_Table
[       OK ] AclTest.Create_L3_Acl_Table (1 ms)
[----------] 1 test from AclTest (1 ms total)

[----------] 3 tests from AclOrchTest
[ RUN      ] AclOrchTest.ACL_Creation_and_Destorying
[New Thread 0x7ffff7597700 (LWP 4738)]
tests: malloc.c:2385: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.

Thread 1 "tests" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7682535 in __GI_abort () at abort.c:79
#2  0x00007ffff76dfa68 in __malloc_assert (
    assertion=assertion@entry=0x7ffff77e6230 "(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)", file=file@entry=0x7ffff77e23b0 "malloc.c", line=line@entry=2385, function=function@entry=0x7ffff77e6940 <__PRETTY_FUNCTION__.12983> "sysmalloc") at malloc.c:298
#3  0x00007ffff76e1e6f in sysmalloc (nb=nb@entry=224, av=av@entry=0x7ffff781bc40 <main_arena>) at malloc.c:2382
#4  0x00007ffff76e32c9 in _int_malloc (av=av@entry=0x7ffff781bc40 <main_arena>, bytes=bytes@entry=208) at malloc.c:4133
#5  0x00007ffff76e51a2 in __libc_calloc (n=<optimized out>, elem_size=<optimized out>) at malloc.c:3428
#6  0x00005555555d21c5 in swss::DBConnector::DBConnector (this=0x55555581f080, dbName="ASIC_DB", timeout=<optimized out>, isTcpConn=<optimized out>) at mock_dbconnector.cpp:81
#7  0x00007ffff7d1373e in saivs::Sai::startUnittestThread() () from /usr/lib/x86_64-linux-gnu/libsaivs.so.0
#8  0x00007ffff7cfc7eb in saivs::Sai::initialize(unsigned long, _sai_service_method_table_t const*) () from /usr/lib/x86_64-linux-gnu/libsaivs.so.0
#9  0x00007ffff7ce7738 in sai_api_initialize () from /usr/lib/x86_64-linux-gnu/libsaivs.so.0
#10 0x00005555555b3b71 in aclorch_test::AclOrchTest::SetUp (this=0x555555818510) at aclorch_ut.cpp:252
#11 0x000055555573c3f7 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ()
#12 0x0000555555736db7 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) ()
#13 0x0000555555717825 in testing::Test::Run() ()
#14 0x0000555555718119 in testing::TestInfo::Run() ()
#15 0x0000555555718758 in testing::TestCase::Run() ()
#16 0x0000555555723057 in testing::internal::UnitTestImpl::RunAllTests() ()
#17 0x000055555573d3cc in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ()
#18 0x0000555555737b81 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) ()
#19 0x0000555555721c15 in testing::UnitTest::Run() ()
#20 0x0000555555749a42 in RUN_ALL_TESTS() ()
#21 0x00005555557499d0 in main ()
(gdb) 

@judyjoseph
Copy link
Contributor Author

retest this please

@judyjoseph
Copy link
Contributor Author

This PR change is not needed as I don't remove this current DBConnector constructor DBConnector::DBConnector(const std::string& dbName, unsigned int timeout, bool isTcpConn) in sonic-swss-common/dbconnector.h

@judyjoseph judyjoseph closed this Aug 18, 2020
@judyjoseph judyjoseph deleted the swss-test-break-fix branch August 18, 2020 20:54
EdenGri pushed a commit to EdenGri/sonic-swss that referenced this pull request Feb 28, 2022
…tion (sonic-net#1362)

- What I did
Fixes sonic-net/sonic-buildimage#6437

- How I did it
Changed the configuration file path from plugin to platform directory

- How to verify it
Verify on the device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants