← index #11346PR #2591
Off-topic · high · value 0.608
QUERY · ISSUE

ussl_basic.py.exp test results are wrong for calling close twice?

openby dlechopened 2023-04-26updated 2023-04-27
bug

Encountered while updating to MicroPython 1.20.0.

In tests/extmod/ussl_basic.py, we call close() twice.

https://github.com/micropython/micropython/blob/294baf52b346e400e2255c6c1e82af5b978b18f7/tests/extmod/ussl_basic.py#L54-L57

This prints TestSocket.ioctl 4 0 because of:

https://github.com/micropython/micropython/blob/294baf52b346e400e2255c6c1e82af5b978b18f7/tests/extmod/ussl_basic.py#L18-L20

However, in the .exp file, we are only expecting it to print once (and CI is passing with this):

https://github.com/micropython/micropython/blob/294baf52b346e400e2255c6c1e82af5b978b18f7/tests/extmod/ussl_basic.py.exp#L5

Using one of our Pybricks builds, we are getting the output printed twice though, which seems expected since close() was called twice.

--- /home/runner/work/pybricks-micropython/pybricks-micropython/micropython/tests/results/extmod_ussl_basic.py.exp	2023-04-26 22:57:31.882920388 +0000
+++ /home/runner/work/pybricks-micropython/pybricks-micropython/micropython/tests/results/extmod_ussl_basic.py.out	2023-04-26 22:57:31.882920388 +0000
@@ -3,5 +3,6 @@
 TestSocket.setblocking(False)
 TestSocket.setblocking(True)
 TestSocket.ioctl 4 0
+TestSocket.ioctl 4 0
 OSError: read
 OSError: write

What is the difference? Our build still uses axtls instead of mbed, but since both implementations use the standard MicroPython stream implementations for close, etc. I don't see what the difference could be.

CANDIDATE · PULL REQUEST

WIP: tests/extmod/ussl: Basic coverage for modussl.

closedby hosakaopened 2016-11-02updated 2017-03-27

Some basic tests for modussl_axtls.c. This kind of goes hand in hand with me testing websockets. So I decided to open this PR in parallel to keep an eye on coverage.

Since upy doesn't implement blocking sockets for now (name prints also differ, but that's minor), this is tested with .exp, but could potentially be compatible with cpython later on.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied