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

TestUDP: use ephemeral port #9692

Merged
merged 1 commit into from
Sep 14, 2021

Conversation

kghost
Copy link
Contributor

@kghost kghost commented Sep 14, 2021

Problem

Fix TestUDP failure. The problem is triggered when multiple TestUDP (gcc/clang/mbedtls variant) is running concurrently, then their UDP port may conflict.

Change overview

In TestUDP, use ephemeral port instead of CHIP_PORT (5540)

Testing

Verified by unit-tests

[228/251] ACTION //src/transport/raw/t...//build/toolchain/linux:linux_x64_gcc)
FAILED: gen/src/transport/raw/tests/TestUDP_run.pw_pystamp 
python3 ../../third_party/pigweed/repo/pw_build/py/pw_build/python_runner.py --gn-root ../../ --current-path ../../src/transport/raw/tests --default-toolchain=//build/toolchain/linux:linux_x64_gcc --current-toolchain=//build/toolchain/linux:linux_x64_gcc --touch gen/src/transport/raw/tests/TestUDP_run.pw_pystamp --capture-output -- ../../third_party/pigweed/repo/pw_unit_test/py/pw_unit_test/test_runner.py --runner ../../third_party/pigweed/repo/targets/host/run_test --test tests/TestUDP
INF Test 1/1: [ RUN] TestUDP
ERR ../../third_party/pigweed/repo/targets/host/run_test exited with status 255
OUT [3685167]
'#0:','Test-CHIP-Udp'
'#2:','Setup                 ','PASSED'
[1631567899.867510][3685169:3685169] CHIP:IN: UDP::Init bind&listen port=5540
'#3:','Simple Init Test IPV4 ','PASSED'
[1631567899.867611][3685169:3685169] CHIP:IN: UDP::Init bind&listen port=5540
[1631567899.867640][3685169:3685169] CHIP:IN: TransportMgr initialized
CHIP node ready to service events
../../src/transport/raw/tests/TestUDP.cpp:155: assertion failed: "ReceiveHandlerCallCount == 1"
'#3:','Message Self Test IPV4','FAILED'
[1631567900.867263][3685169:3685169] CHIP:IN: UDP::Init bind&listen port=5540
'#3:','Simple Init Test IPV6 ','PASSED'
[1631567900.867330][3685169:3685169] CHIP:IN: UDP::Init bind&listen port=5540
[1631567900.867354][3685169:3685169] CHIP:IN: TransportMgr initialized
'#3:','Message Self Test IPV6','PASSED'
[1631567900.867482][3685169:3685175] CHIP:IN: Async DNS worker thread woke up.
[1631567900.867524][3685169:3685175] CHIP:IN: Async DNS worker thread exiting.
[1631567900.867531][3685169:3685174] CHIP:IN: Async DNS worker thread woke up.
[1631567900.867581][3685169:3685174] CHIP:IN: Async DNS worker thread exiting.
'#4:','Teardown              ','PASSED'
'#6:','1','4'
'#7:','1','17'
INF Test 1/1: [FAIL] TestUDP
[233/251] ACTION //src/app/tests:TestC...//build/toolchain/linux:linux_x64_gcc)
ninja: build stopped: subcommand failed.

Copy link
Contributor

@mlepage-google mlepage-google left a comment

Choose a reason for hiding this comment

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

Issue #6947 was happening regularly for me, but with this change, it hasn't happened after half a dozen attempts.

@github-actions
Copy link

Size increase report for "nrfconnect-example-build" from 29e6bcd

File Section File VM
chip-shell.elf rodata 24 28
chip-shell.elf text 24 24
chip-shell.elf device_handles 8 8
chip-lock.elf rodata 24 24
chip-lock.elf text 24 24
chip-lock.elf device_handles 8 8
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
.debug_info,0,146
.debug_loc,0,113
.debug_line,0,99
.strtab,0,43
.debug_str,0,39
.symtab,0,32
.debug_frame,0,28
rodata,28,24
text,24,24
.debug_abbrev,0,15
.debug_aranges,0,8
.debug_ranges,0,8
device_handles,8,8
.shstrtab,0,-3

Comparing ./master_artifact/chip-lock.elf and ./pull_artifact/chip-lock.elf:

sections,vmsize,filesize
.debug_info,0,146
.debug_line,0,99
.debug_loc,0,81
.strtab,0,43
.debug_str,0,39
.symtab,0,32
.debug_frame,0,28
rodata,24,24
text,24,24
.debug_abbrev,0,15
.debug_aranges,0,8
.debug_ranges,0,8
device_handles,8,8
.shstrtab,0,1


@github-actions
Copy link

Size increase report for "esp32-example-build" from 29e6bcd

File Section File VM
chip-temperature-measurement-app.elf .flash.text 104 104
chip-temperature-measurement-app.elf .flash.rodata 24 24
chip-all-clusters-app.elf .flash.rodata 32 32
chip-all-clusters-app.elf .flash.text 32 32
chip-bridge-app.elf .flash.text 116 116
chip-bridge-app.elf .flash.rodata 24 24
chip-shell.elf .flash.text 100 100
chip-shell.elf .flash.rodata 24 24
chip-lock-app.elf .flash.text 108 108
chip-lock-app.elf .flash.rodata 24 24
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-persistent-storage.elf and ./pull_artifact/chip-persistent-storage.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-temperature-measurement-app.elf and ./pull_artifact/chip-temperature-measurement-app.elf:

sections,vmsize,filesize
.debug_line,0,176
.debug_info,0,158
.flash.text,104,104
.debug_loc,0,50
.strtab,0,43
.debug_str,0,40
.debug_frame,0,24
.flash.rodata,24,24
.symtab,0,16
.debug_aranges,0,8
.debug_ranges,0,8
.shstrtab,0,1
[Unmapped],0,-128

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize
.debug_line,0,174
.debug_info,0,153
.debug_loc,0,48
.strtab,0,43
.debug_str,0,39
.flash.rodata,32,32
.flash.text,32,32
.debug_frame,0,28
.symtab,0,16
.debug_abbrev,0,15
.debug_aranges,0,8
.debug_ranges,0,8
.riscv.attributes,0,-1
.shstrtab,0,-3
[Unmapped],0,-64

Comparing ./master_artifact/chip-bridge-app.elf and ./pull_artifact/chip-bridge-app.elf:

sections,vmsize,filesize
.debug_line,0,176
.debug_info,0,158
.flash.text,116,116
.strtab,0,43
.debug_str,0,36
.debug_frame,0,24
.flash.rodata,24,24
.symtab,0,16
.debug_loc,0,10
.debug_aranges,0,8
.debug_ranges,0,8
.shstrtab,0,1
[Unmapped],0,-140

Comparing ./master_artifact/chip-ipv6only-app.elf and ./pull_artifact/chip-ipv6only-app.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
.debug_line,0,176
.debug_info,0,158
.flash.text,100,100
.strtab,0,43
.debug_str,0,40
.debug_loc,0,26
.debug_frame,0,24
.flash.rodata,24,24
.symtab,0,16
.debug_aranges,0,8
.debug_ranges,0,8
.shstrtab,0,1
[Unmapped],0,-124

Comparing ./master_artifact/chip-lock-app.elf and ./pull_artifact/chip-lock-app.elf:

sections,vmsize,filesize
.debug_line,0,176
.debug_info,0,158
.flash.text,108,108
.strtab,0,43
.debug_str,0,40
.debug_loc,0,30
.debug_frame,0,24
.flash.rodata,24,24
.symtab,0,16
.xt.prop._ZNK4chip4SpanIhE7SubSpanEjj,0,12
.debug_aranges,0,8
.debug_ranges,0,8
.xt.lit._ZNK4chip4SpanIhE7SubSpanEjj,0,8
.shstrtab,0,1
[Unmapped],0,-132

Comparing ./master_artifact/chip-pigweed-app.elf and ./pull_artifact/chip-pigweed-app.elf:

sections,vmsize,filesize


@woody-apple woody-apple merged commit b384bde into project-chip:master Sep 14, 2021
@kghost kghost deleted the udp-test-random-port branch September 15, 2021 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestUDP is failing for some developers
7 participants