Skip to content

Greentea tests: user-configurable timeouts #9718

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

Merged

Conversation

michalpasztamobica
Copy link
Contributor

Description

Now it is enough to add:
"macros": [
"MBED_GREENTEA_TEST_XXXSOCKET_TIMEOUT_S=20"
],
to mbed_app.json, where XXX is on of {DNS, TLS, UDP, TCP}.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[x] Test update
[ ] Breaking change

Reviewers

@SeppoTakalo
@AriParkkila
@pekkapesu

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 14, 2019

macros , not rather test config?

@michalpasztamobica
Copy link
Contributor Author

@0xc0170 , could you elaborate on this idea or point me to some existing test config?

@michalpasztamobica
Copy link
Contributor Author

@0xc0170 , do you mean adding something into the "config" section of the mbed_app.json? Like so:

{
    "config": {
        "tcp_timeout" : {
            "help" : "TCP timeout",
            "value" : 100
        },

? This would make sense, indeed. I didn't think about it...

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 14, 2019

I recall some tools had some problems with "MBED_GREENTEA_TEST_XXXSOCKET_TIMEOUT_S=20" but can't recall further details at the moment.

I am not fan of having macros used this way (setting default values and expect a user to overwrite them), rather use config.

@SeppoTakalo
Copy link
Contributor

Well... test cases cannot expose mbed_lib.json so they cannot easily expose configuration values.

We do configure test cases, but that is done through mbed_app.json through well known configuration values. Like this: https://github.com/ARMmbed/mbed-os/blob/master/tools/test_configs/HeapBlockDeviceAndWifiInterface.json

I'm OK with both approaches, macros or known mbed_app.json values. I want default that work 90 % of the time, and is not required to specify anywhere. And the rest is 10 % which is Cellular testing and requires specific environment anyway.

@michalpasztamobica
Copy link
Contributor Author

I assume the configs should be used for something that changes frequently (like communication baudrate, shield board type, etc.). Macros seem to be more of a possibility to make a temporary hack (like heap size increase).

I think macros are a better choice in our case. As Seppo suggested: most of the time we want to keep the same value of the timeout. In few special runs, at the moment only for cellular modules, we want to allow some larger timeouts and we want to avoid hacking the source code to do that.
I honestly don't fully support the idea of ports and server addresses for echo/discard tests being configured via the configs - they almost never change.

@0xc0170 , would you agree with the above?
@AriParkkila @pekkapesu , do you have any strong opinion here?

@ciarmcom
Copy link
Member

@michalpasztamobica, thank you for your changes.
@AriParkkila @SeppoTakalo @pekkapesu @ARMmbed/mbed-os-test @ARMmbed/mbed-os-ipcore @ARMmbed/mbed-os-maintainers please review.

@ciarmcom ciarmcom requested a review from a team February 14, 2019 14:00
@michalpasztamobica michalpasztamobica force-pushed the greentea_tcpsocket_suite_timeout branch from dfe9b5e to 828d397 Compare February 15, 2019 07:52
Copy link
Contributor

@VeijoPesonen VeijoPesonen left a comment

Choose a reason for hiding this comment

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

I assume tests-network-interface doesn't require anything similar

@AriParkkila
Copy link

I assume tests-network-interface doesn't require anything similar

I guess it might due to joining to cellular network may take minutes...

@michalpasztamobica
Copy link
Contributor Author

michalpasztamobica commented Feb 15, 2019

I assume tests-network-interface doesn't require anything similar

I guess it might due to joining to cellular network may take minutes...

Ok, I will add them in a minute.

@michalpasztamobica michalpasztamobica force-pushed the greentea_tcpsocket_suite_timeout branch from 828d397 to 758914d Compare February 15, 2019 10:26
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 15, 2019

Please fix astyle error (1 line)

Now it is enough to add:
    "macros": [
        "MBED_GREENTEA_TEST_XXXSOCKET_TIMEOUT_S=20"
    ],
to mbed_app.json, where XXX is on of {DNS, TLS, UDP, TCP}.
Also network-* tests are now configurable: network-interface, network-wifi, network-emac with a similar macro.
@michalpasztamobica michalpasztamobica force-pushed the greentea_tcpsocket_suite_timeout branch from 758914d to ca57bdd Compare February 15, 2019 13:08
Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

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

Neat!

@cmonr
Copy link
Contributor

cmonr commented Feb 15, 2019

CI started

@mbed-ci
Copy link

mbed-ci commented Feb 15, 2019

Test run: FAILED

Summary: 1 of 10 test jobs failed
Build number : 1
Build artifacts

Failed test jobs:

  • jenkins-ci/mbed-os-ci_exporter

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 18, 2019

CI was restart, all green

@cmonr
Copy link
Contributor

cmonr commented Feb 21, 2019

Interesting. Unsure why this didn't want to be applied to the mbed-os-5.11 branch. Suspect that a config param was introduced into 5.12. Retargeting this PR for 5.12.

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.

8 participants