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

Fix network echo test host scripts for Mac #3436

Merged
merged 2 commits into from Dec 15, 2016
Merged

Conversation

bulislaw
Copy link
Member

Status

READY

It seems that the 0 aka 'any port' doesn't work well on Mac, causing
[Errno 49] Can't assign requested address errors.

[1481634494.19][HTST][ERR] something went wrong in event main loop!
[1481634494.19][HTST][INF] ==== Traceback start ====
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/mbed_host_tests/host_tests_runner/host_test_default.py", line 364, in run_test
    callbacks[key](key, value, timestamp)
  File "/Users/barsza01/devel/mbed/code/mbed-os/features/FEATURE_LWIP/TESTS/mbedmicro-net/host_tests/udp_echo_client.py", line 104, in _callback_target_ip
    self.SERVER_IP = self.find_interface_to_target_addr(self.target_ip)
  File "/Users/barsza01/devel/mbed/code/mbed-os/features/FEATURE_LWIP/TESTS/mbedmicro-net/host_tests/udp_echo_client.py", line 58, in find_interface_to_target_addr
    s.connect((target_ip, 0)) # Target IP, Any port
  File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 49] Can't assign requested address

This PR makes connection to a random port (8000) to get the local if address.

CC: @geky @bridadan

@geky
Copy link
Contributor

geky commented Dec 13, 2016

Is it possible to fall back to 8000 only after the exception? This patch prevents multiple network tests from running in parallel on the same machine.

Guess:

try:
    s.connect((target_ip, 0))
except socket.error:
    s.connect((target_ip, 8000))

@geky geky requested review from bridadan and geky December 13, 2016 15:26
@bulislaw
Copy link
Member Author

Fixed now.

@bridadan
Copy link
Contributor

retest uvisor

@bridadan
Copy link
Contributor

/morph test-nightly

@mbed-bot
Copy link

Result: FAILURE

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1263

Test failed!

@bridadan
Copy link
Contributor

Maintainers: please hold off on restarting tests for this, I added a new platform to the CI and it caused the failure. I will restart this when I've resolved the problem.

@bridadan
Copy link
Contributor

/morph test-nightly

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1264

All builds and test passed!

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 14, 2016

@marhil01 The failure for pr-head : 18:10:20 [8023] | interface_up_down | fail | dut1 cmd: 'ifconfig eth0 down' | | 16.850091 | . I have seen this before, is this related to this patch (I don't think so as this patch is touching test scripts?) or instability somewhere?

@bridadan
Copy link
Contributor

retest uvisor

@bridadan
Copy link
Contributor

cc @VeliMattiLahtela about the CI failure.

@jupe
Copy link
Contributor

jupe commented Dec 14, 2016

most probably this PR based too old mbed-os baseline which has bugs and that why some tests fails now. Especially this fix is now missing: #3193. Please rebase/merge against master head to see if last ci passes.

@bridadan
Copy link
Contributor

@bulislaw would you mind rebasing this on top of master to confirm @jupe's suggestion?

@jupe, ideally the Oulu CI would merge this PR into the latest master of mbed-os, then run all of its tests. That's what we do on the rest of our CI setups. This has helped us move quickly and reduce the number of rebases that contributors have to do. Do you think this would be possible?

It seems that the 0 aka 'any port' doesn't work well on Mac, causing
[Errno 49] Can't assign requested address errors.
The 0 aka 'any' port doesn't for on Mac, but, only, using defined port
may interfere with running multiple tests on CI.
@bulislaw
Copy link
Member Author

Done

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 15, 2016

Thanks @jupe for the tip. All green !

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 15, 2016

/morph test-nightly

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1271

All builds and test passed!

@sg- sg- merged commit 899c542 into master Dec 15, 2016
@bulislaw bulislaw deleted the net_echo_test_host_fix branch December 15, 2016 17:04
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.

None yet

7 participants