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

tests/gnrc_rpl: speed up test #19134

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Jan 12, 2023

Contribution description

Add a printout when the global prefix has been received that we can await.
Strangely we still have to wait 5s after that for ping to work.

Testing procedure

make -C tests/gnrc_rpl all test

should still work.

Without 5s sleep, routing is broken
 -=[ A ]=-
ifconfig
Iface  5  HWaddr: 5E:76  Channel: 26  NID: 0x23  PHY: O-QPSK 
          Long HWaddr: E6:B2:35:37:6F:CC:DE:76 
           State: IDLE 
          ACK_REQ  L2-PDU:102  MTU:1280  HL:64  RTR  
          6LO  IPHC  
          Source address length: 8
          Link type: wireless
          inet6 addr: fe80::e4b2:3537:6fcc:de76  scope: link  VAL
          inet6 addr: 2001:db8::1  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ffcc:de76
          inet6 group: ff02::1a
          inet6 group: ff02::1:ff00:1
          

rpl
instance table:	[X]	
parent table:	[ ]	[ ]	[ ]	

instance [0 | Iface: 5 | mop: 2 | ocp: 0 | mhri: 256 | mri 0]
	dodag [2001:db8::1 | R: 256 | OP: Router | PIO: on | TR(I=[8,20], k=10, c=1)]

nib route
2001:db8::/32 dev #5

 -=[ B ]=-
ifconfig
Iface  5  HWaddr: 6E:86  Channel: 26  NID: 0x23  PHY: O-QPSK 
          Long HWaddr: 7E:D6:55:9B:BF:1C:6E:86 
           State: IDLE 
          ACK_REQ  L2-PDU:102  MTU:1280  HL:64  RTR  
          6LO  IPHC  
          Source address length: 8
          Link type: wireless
          inet6 addr: fe80::7cd6:559b:bf1c:6e86  scope: link  VAL
          inet6 addr: 2001:db8::7cd6:559b:bf1c:6e86  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff1c:6e86
          inet6 group: ff02::1a
          

rpl
instance table:	[X]	
parent table:	[X]	[ ]	[ ]	

instance [0 | Iface: 5 | mop: 2 | ocp: 0 | mhri: 256 | mri 0]
	dodag [2001:db8::1 | R: 512 | OP: Router | PIO: on | TR(I=[8,20], k=10, c=2)]
		parent [addr: fe80::e4b2:3537:6fcc:de76 | rank: 256]

nib route
2001:db8::/64 dev #5
default* via fe80::e4b2:3537:6fcc:de76 dev #5

 -=[ C ]=-
ifconfig
Iface  5  HWaddr: 5E:F6  Channel: 26  NID: 0x23  PHY: O-QPSK 
          Long HWaddr: E6:62:B5:07:EF:4C:5E:F6 
           State: IDLE 
          ACK_REQ  L2-PDU:102  MTU:1280  HL:64  RTR  
          6LO  IPHC  
          Source address length: 8
          Link type: wireless
          inet6 addr: fe80::e462:b507:ef4c:5ef6  scope: link  VAL
          inet6 addr: 2001:db8::e462:b507:ef4c:5ef6  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff4c:5ef6
          inet6 group: ff02::1a
          

rpl
instance table:	[X]	
parent table:	[X]	[ ]	[ ]	

instance [0 | Iface: 5 | mop: 2 | ocp: 0 | mhri: 256 | mri 0]
	dodag [2001:db8::1 | R: 768 | OP: Router | PIO: on | TR(I=[8,20], k=10, c=2)]
		parent [addr: fe80::7cd6:559b:bf1c:6e86 | rank: 512]

nib route
2001:db8::/64 dev #5
default* via fe80::7cd6:559b:bf1c:6e86 dev #5

 -=[ D ]=-
ifconfig
Iface  5  HWaddr: 73:C1  Channel: 26  NID: 0x23  PHY: O-QPSK 
          Long HWaddr: 7E:56:B4:97:DA:1F:F3:C1 
           State: IDLE 
          ACK_REQ  L2-PDU:102  MTU:1280  HL:64  RTR  
          6LO  IPHC  
          Source address length: 8
          Link type: wireless
          inet6 addr: fe80::7c56:b497:da1f:f3c1  scope: link  VAL
          inet6 addr: 2001:db8::7c56:b497:da1f:f3c1  scope: global  VAL
          inet6 group: ff02::2
          inet6 group: ff02::1
          inet6 group: ff02::1:ff1f:f3c1
          inet6 group: ff02::1a
          

rpl
instance table:	[X]	
parent table:	[X]	[ ]	[ ]	

instance [0 | Iface: 5 | mop: 2 | ocp: 0 | mhri: 256 | mri 0]
	dodag [2001:db8::1 | R: 1024 | OP: Router | PIO: on | TR(I=[8,20], k=10, c=0)]
		parent [addr: fe80::e462:b507:ef4c:5ef6 | rank: 768]

nib route
2001:db8::/64 dev #5
default* via fe80::e462:b507:ef4c:5ef6 dev #5

ping 2001:db8::1

--- 2001:db8::1 PING statistics ---
3 packets transmitted, 0 packets received, 100% packet loss

Issues/PRs references

@benpicco benpicco requested a review from miri64 as a code owner January 12, 2023 14:59
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 12, 2023
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Jan 12, 2023
@riot-ci
Copy link

riot-ci commented Jan 12, 2023

Murdock results

✔️ PASSED

cfac5e5 tests/gnrc_rpl: speed up test

Success Failures Total Runtime
43 0 43 01m:44s

Artifacts

Add a printout when the global prefix has been received that we can await.
Strangely we still have to wait 5s after that for ping to work.
@benpicco benpicco added the Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation label Jan 12, 2023
@benpicco
Copy link
Contributor Author

bors try

bors bot added a commit that referenced this pull request Jan 12, 2023
@miri64
Copy link
Member

miri64 commented Jan 12, 2023

Strangely we still have to wait 5s after that for ping to work.

Did you check if the DODAG was actually constructed at that point (i.e. if the pinging nodes have a parent)?

Comment on lines -93 to +94
A.cmd("nib prefix add 5 2001:db8::/32")
A.cmd("ifconfig 5 add 2001:db8::1/32")
A.cmd("nib prefix add 5 2001:db8::/64")
A.cmd("ifconfig 5 add 2001:db8::1/64")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this change needed?

Copy link
Contributor Author

@benpicco benpicco Jan 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not needed, but a /64 is also enough and more idiomatic

Comment on lines -140 to +142
A.cmd("nib prefix add 5 2001:db8::/32")
A.cmd("ifconfig 5 add 2001:db8::1/32")
A.cmd("nib prefix add 5 2001:db8::/64")
A.cmd("ifconfig 5 add 2001:db8::1/64")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this?

@benpicco
Copy link
Contributor Author

Did you check if the DODAG was actually constructed at that point

yes, click the "Without 5s sleep, routing is broken" to expand the results

@miri64
Copy link
Member

miri64 commented Jan 12, 2023

Is it exactly 5s or did you pick that value arbitrarily?

@benpicco
Copy link
Contributor Author

4s also works, 3s is too little

@miri64
Copy link
Member

miri64 commented Jan 12, 2023

Ok, I thought it might have to do something with address registration, but then again, the global address is valid already. Should we document this in an issue?

@bors
Copy link
Contributor

bors bot commented Jan 12, 2023

try

Build succeeded:

@benpicco
Copy link
Contributor Author

I created an issue: #19147

@kaspar030
Copy link
Contributor

make test gives this error, similar to the flakey CI failures:

Traceback (most recent call last):
  File "/home/kaspar/src/riot/tests/gnrc_rpl/tests/01-run.py", line 178, in <module>
    run_test(test_alternative_route, factory)
  File "/home/kaspar/src/riot/tests/gnrc_rpl/tests/01-run.py", line 170, in run_test
    func(factory, zep_dispatch)
  File "/home/kaspar/src/riot/tests/gnrc_rpl/tests/01-run.py", line 155, in test_alternative_route
    assert result['stats']['packet_loss'] < 10
AssertionError

But this PR is not intended to fix that, right?

@benpicco
Copy link
Contributor Author

I had hoped by actually waiting for the global address the test would be more stable, but that didn’t turn out to be the case 😔

@kaspar030
Copy link
Contributor

hm, my first run failed, now I'm at ~15, all runs after the first succeeded

@miri64
Copy link
Member

miri64 commented Jan 17, 2023

Maybe something akin to https://pypi.org/project/pytest-rerunfailures/ to our tests would help here (or we port the test to pytest directly and just use that plug-in ;-P). With the TEST_EXECUTOR environment variable, this should be a breeze to port.

@benpicco benpicco requested a review from maribu January 19, 2023 12:32
@benpicco benpicco added the State: waiting for maintainer State: Action by a maintainer is required label Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR State: waiting for maintainer State: Action by a maintainer is required Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants