Testing for ns3 modules.

204 views
Skip to first unread message

Shreyas Udaya

unread,
Nov 1, 2023, 6:18:44 AM11/1/23
to ns-3-users
When I was testing for ns3 modules I found out some tests kept crashing. Later when I saw the AddTestCase column in the test file I observed it was because it had TestCase::QUICK. When I changed QUICK to EXTENSIVE the problem was resolved. 
Why is this so? Is this due to the complexity and time those particular test cases take?

Gabriel Ferreira

unread,
Nov 1, 2023, 6:49:44 AM11/1/23
to ns-3-users
Tests should not fail. Unless you're using an older version on Windows, WSLv1 or ARM,
 which round floating points differently than x86. 

Tommaso Pecorella

unread,
Nov 1, 2023, 7:38:55 AM11/1/23
to ns-3-users
Changing to EXTENSIVE silences the test because it's not run (normally). See the test.py option:

  -f {QUICK,EXTENSIVE,TAKES_FOREVER}, --fullness {QUICK,EXTENSIVE,TAKES_FOREVER}
                        choose the duration of tests to run: QUICK, EXTENSIVE, or TAKES_FOREVER, where EXTENSIVE includes QUICK and TAKES_FOREVER includes QUICK and EXTENSIVE (only QUICK tests are run by default)

only the QUICK tests are run by default, so changing the failing tests to EXTENSIVE hides them in a "normal" run.


Shreyas Udaya

unread,
Nov 2, 2023, 2:12:27 AM11/2/23
to ns-3-users
So does this mean the test is still failing? 

Tommaso Pecorella

unread,
Nov 2, 2023, 6:07:19 AM11/2/23
to ns-3-users
Yes.

Shreyas Udaya

unread,
Nov 6, 2023, 2:35:37 AM11/6/23
to ns-3-users
How do I usually fix it? Is it more related to the system than the individual files themselves?

Tommaso Pecorella

unread,
Nov 6, 2023, 8:07:02 AM11/6/23
to ns-3-users

It depends on the test and why it's failing. On an un-modified ns-3 tests should not fail, so there are only a few other possibilities.
1. You created more tests - it's your responsibility to make them right (of course).
2. You did modify ns-3 code, and tests are now failing. Probably your modifications are not perfect, and they have to be triple checked. Use a debugger.
3. Like 2, but you're sure that your changes are right. Some tests might fail because they're sensitive to the setup, so they might fail if "something" did change. Examples are the ones relying on specific message sequences.

In any case, they should crash, they should fail. A crash is usually an indication that there's a serious problem (i.e., a bug), and the best suggestion is... a debugger.

So, the first question is: did you modify ns-3? If so, what are the modifications? The culprit is usually there.

Shreyas Udaya

unread,
Nov 6, 2023, 10:06:21 AM11/6/23
to ns-3-users
The file is not my own, but rather one already in the code, src/core/test/threaded-test-suite.cc, also known as threaded simulator. And when I test it, it was crashing. 

Shreyas Udaya

unread,
Nov 6, 2023, 10:08:32 AM11/6/23
to ns-3-users
Note: I did not modify the file at all

Gabriel Ferreira

unread,
Nov 6, 2023, 10:09:54 AM11/6/23
to ns-3-users
What is your operating system?

Shreyas Udaya

unread,
Nov 6, 2023, 12:30:25 PM11/6/23
to ns-3-users
Ubuntu 23.04. The test case passes when diagnosing using gdb, but fails while running ./test.py
Reply all
Reply to author
Forward
0 new messages