Skip to content

tests/qdsa: Move from unittests to regular tests#10185

Merged
cladmi merged 1 commit intoRIOT-OS:masterfrom
bergzand:pr/tests/qdsa_move
Nov 28, 2018
Merged

tests/qdsa: Move from unittests to regular tests#10185
cladmi merged 1 commit intoRIOT-OS:masterfrom
bergzand:pr/tests/qdsa_move

Conversation

@bergzand
Copy link
Copy Markdown
Member

@bergzand bergzand commented Oct 17, 2018

And another!

Contribution description

similar to #10183, this is another large package that only increases the size of the unittests.

Testing procedure

Run the tests/pkg_qdsa test.

Issues/PRs references

Part of #10187

@bergzand bergzand added Area: tests Area: tests and testing framework Area: pkg Area: External package ports Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 17, 2018
@bergzand bergzand requested review from cladmi and kaspar030 October 17, 2018 20:19
@kaspar030
Copy link
Copy Markdown
Contributor

LGTM.

Copy link
Copy Markdown
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

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

ACK.

@bergzand
Copy link
Copy Markdown
Member Author

Adjusted blacklist and insufficient memory list based on Murdock results.

@bergzand bergzand added CI: run tests If set, CI server will run tests on hardware for the labeled PR CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR labels Oct 17, 2018
@bergzand
Copy link
Copy Markdown
Member Author

Test takes around 66 seconds on a samr21-xpro:

2018-10-17 22:49:44,610 - INFO # main(): This is RIOT! (Version: 2018.10-devel-1213-g386c9-dystopia-pr/tests/libcose_move)
2018-10-17 22:50:50,990 - INFO # ...
2018-10-17 22:50:50,991 - INFO # OK (3 tests)

Also here the question whether we want to have this run on the CI?

Copy link
Copy Markdown
Contributor

@cladmi cladmi left a comment

Choose a reason for hiding this comment

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

Test takes around 66 seconds on a samr21-xpro:

2018-10-17 22:49:44,610 - INFO # main(): This is RIOT! (Version: 2018.10-devel-1213-g386c9-dystopia-pr/tests/libcose_move)
2018-10-17 22:50:50,990 - INFO # ...
2018-10-17 22:50:50,991 - INFO # OK (3 tests)

Also here the question whether we want to have this run on the CI?

This one takes only 7.6 seconds on samr21-xpro I think you mixed with the libcose test according to the output :)
So it could still be run on CI.

Other than this the test worked on iotlab-m3 and samr21-xpro.

@bergzand
Copy link
Copy Markdown
Member Author

This one takes only 7.6 seconds on samr21-xpro I think you mixed with the libcose test according to the output :)

You're right, mixed up a few numbers. As the PR is now, the test is run on all.

@cladmi cladmi added the CI: run tests If set, CI server will run tests on hardware for the labeled PR label Oct 21, 2018


def testfunc(child):
child.expect('OK \(\d+ tests\)', timeout=120)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The timeout commit can be removed as it should not be necessary, I see 5 seconds execution for an iotlab-m3 and 3 seconds for samr21-xpro.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To be more precise, the 7.6 seconds I mentioned in the main review is the total time counted by time.
But the time actually spend in the test is ~3 seconds.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ack, sloppy copy-paste code after moving too many package tests :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

removed!


BOARD_INSUFFICIENT_MEMORY := arduino-duemilanove arduino-uno nucleo-f031k6

CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_DEFAULT\)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

As the issue also happened in test/tweetnacl I think you should keep the increased stack size for avrboards

AVR_BOARDS := arduino-duemilanove \
               arduino-mega2560 \
               arduino-uno \
               waspmote-pro \
#
CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_DEFAULT+THREAD_EXTRA_STACKSIZE_PRINTF\)

This way, we could merge this without re-checking them for now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is it also okay if I increase the THREAD_STACKSIZE_DEFAULT multiplier by 1? It doesn't really make sense to increase the stack size by THREAD_EXTRA_STACKSIZE_PRINTF if there are no printf statements in the code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Then it should be re-tested on avr which I cannot do today.
By only moving them without changing the "absurd" size, it is easy to merge.
Fixing the stack size can be another task.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is only one platform where increasing it to 5*THREAD_STACKSIZE_DEFAULT would result in a lower total stack size compared to 4*THREAD_STACKSIZE_DEFAULT+THREAD_EXTRA_STACKSIZE_PRINTF: the lpc2387. For all other platforms, the THREAD_STACKSIZE_DEFAULT is larger than the THREAD_EXTRA_STACKSIZE_PRINTF.

I don't mind if you want to retest on the avr platforms anyway, I'm not in that much of a hurry with this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, I did not check the exact values for this. Thank you for researching it.
If 5* is bigger no need to retest for them.

So I like to keep the 5 * here as you updated and please explain it in the commit message (also that the lpc2387 is now smaller and not re-tested).
Putting your last comment directly is good for me.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This concern and solving justification also applies for the other LARGE_STACK_TESTS tests you migrated.

@cladmi cladmi added Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines labels Oct 21, 2018
@cladmi
Copy link
Copy Markdown
Contributor

cladmi commented Oct 21, 2018

Agreed with the timeout, only need to update to 5*THREAD_STACKSIZE_DEFAULT and put it in the commit message.
You can directly squash when changing these.

I tested with iotlab-m3 and samr21-xpro and the timeout is good for them. No corrupt stack.

@bergzand
Copy link
Copy Markdown
Member Author

@cladmi squashed and reworded the commit message. Please check whether it contains al the requested information. Thanks for the thorough testing of this PR (and all the related PRs)

@bergzand bergzand added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR labels Oct 21, 2018
@cladmi
Copy link
Copy Markdown
Contributor

cladmi commented Oct 23, 2018

The commit says 5* but the change is still 4*THREAD_STACKSIZE_DEFAULT.

However I now tested with arduino-mega2560 and it works without warning message. A ps gives me this for main thread:

Stack ( used)
   1024 (  734)

From the other avr boards, waspmote-pro has the same THREAD_STACKSIZE_DEFAULT and the two other ones are blacklisted.

So with this 4 can be enough to keep for this test.

For information, for samr21-xpro I get 4096 ( 988) and iotlab-m3 I get 4096 ( 1220).

@bergzand
Copy link
Copy Markdown
Member Author

@cladmi Sorry for forgetting to change the actual value.

So now change the commit message to reflect the current situation?

@cladmi
Copy link
Copy Markdown
Contributor

cladmi commented Oct 23, 2018

By keeping it to 5 for the moment, it may keep other boards we did not re-test still working.
It is the "do not change without reason" solution :)

If you prefer putting 4, just put my stack usage infos as reference.

As long as it is consistent with the change and the justification I am ok.

@cladmi
Copy link
Copy Markdown
Contributor

cladmi commented Oct 23, 2018

I "merged" from the web interface to check murdock output.

@bergzand
Copy link
Copy Markdown
Member Author

Okay...

@cladmi
Copy link
Copy Markdown
Contributor

cladmi commented Oct 24, 2018

But then murdock cannot rebase it anymore anyway D:

@cladmi
Copy link
Copy Markdown
Contributor

cladmi commented Nov 27, 2018

I am finally back after the release, can you please rebase, I think it was good to go, I will quickly re-test after rebase.

Stack size is changed from 4 times the default + printf to 5 times the
default stack size. Only on the lpc2387 this reduces the resulting stack
space. the test is not rerun for the lpc2387 and is untested.
@bergzand
Copy link
Copy Markdown
Member Author

rebased!

@bergzand
Copy link
Copy Markdown
Member Author

I might have screwed something up here with my rebase. I suspect I lost a commit here :(

@miri64
Copy link
Copy Markdown
Member

miri64 commented Nov 28, 2018

git reflog and search ;-). Good luck!

@cladmi
Copy link
Copy Markdown
Contributor

cladmi commented Nov 28, 2018

The rebase looks ok for me, by comparing both commits against your rebase base I get this "merge-diff":

git show $(git commit-tree 'f9eebce43^{tree}' -p 4631180f1 -p 4eaf1d813 -m commit-tree)

commit 94dca98d9e0be29e3a17edf55093622097ca35eb
Merge: 4631180f1 4eaf1d813
Author: Gaëtan Harter <gaetan.harter@fu-berlin.de>
Date:   Wed Nov 28 19:45:16 2018 +0100

    commit-tree

diff --cc tests/unittests/Makefile
index dfea5bdbf,f24eb63bd..c8dae1960
--- a/tests/unittests/Makefile
+++ b/tests/unittests/Makefile
@@@ -231,8 -231,10 +231,6 @@@ ifneq (,$(filter tests-cpp_%, $(UNIT_TE
    export CPPMIX := 1
  endif
  
 -ifneq (, $(filter $(AVR_BOARDS), $(BOARD)))
 -  LARGE_STACK_TESTS += tests-qDSA
 -endif
--
- LARGE_STACK_TESTS += tests-tweetnacl
  ifneq (,$(filter $(LARGE_STACK_TESTS), $(UNIT_TESTS)))
    CFLAGS += -DTHREAD_STACKSIZE_MAIN=\(4*THREAD_STACKSIZE_DEFAULT+THREAD_EXTRA_STACKSIZE_PRINTF\)
  endif

Which corresponds to the rebased version on top of the tests-tweetnacl PR.
So for me the rebase is good.

We also note that after this PR, the LARGE_STACK_TESTS handling can be removed from unittests.

Copy link
Copy Markdown
Contributor

@cladmi cladmi left a comment

Choose a reason for hiding this comment

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

ACK

I successfully tested on IoT-LAB for the following boards:

BOARDS="samr21-xpro pba-d-01-kw2x b-l475e-iot01a nrf52dk arduino-zero nrf52840dk iotlab-m3 microbit frdm-kw41z"
for board in ${BOARDS}; do BOARD=${board} RIOT_CI_BUILD=1 IOTLAB_NODE=auto-ssh BUILD_IN_DOCKER=1 DOCKER="sudo docker" make --no-print-directory -C tests/pkg_qdsa clean all flash test || break; done

I also re-tested locally on arduino-mega2560

Removing LARGE_STACK_TESTS will be done separately.

@cladmi cladmi merged commit fdde802 into RIOT-OS:master Nov 28, 2018
@aabadie aabadie added this to the Release 2019.01 milestone Dec 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: pkg Area: External package ports 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 CI: run tests If set, CI server will run tests on hardware for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants