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

Windows 10 Not found Match with Serial (RDT-535) #226

Closed
1 task done
breakersun opened this issue Aug 26, 2023 · 5 comments
Closed
1 task done

Windows 10 Not found Match with Serial (RDT-535) #226

breakersun opened this issue Aug 26, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@breakersun
Copy link

breakersun commented Aug 26, 2023

Describe the bug
On Windows 10

Configuration Files

  • pytest.ini
[pytest]
addopts = --embedded-services serial -s

# log related
log_cli = True
log_cli_level = INFO
log_cli_format = %(asctime)s %(levelname)s %(message)s
log_cli_date_format = %Y-%m-%d %H:%M:%S

To Reproduce
Steps to reproduce the behavior:

  1. Run pytest -v
  2. Got error message
>               raise e.__class__(debug_str) from e
E               pexpect.exceptions.TIMEOUT: Not found "[ATSS]:ATS"
E               Bytes in current buffer (color code eliminated): # [ATSS]:ATS:START
E               Please check the full log here: C:\Users\403283\AppData\Local\Temp\pytest-embedded\2023-08-26_05-55-34-035987\test_echo_tcp[COM4]\dut.log

..\..\scoop\apps\python\current\Lib\site-packages\pytest_embedded\dut.py:82: TIMEOUT
=========================== short test summary info ===========================
FAILED test_ats.py::test_echo_tcp[COM4] - pexpect.exceptions.TIMEOUT: Not fou...
============================== 1 failed in 1.66s ==============================

Expected behavior
It should match the pattern in the buffer. the pattern actually in the buffer.

Dev Environment (please complete the following information):

  • OS: Windows 10
  • Python Version 3.11.1
  • Pytest Version 7.4.0
  • pytest-embedded Version 1.3.4
@breakersun breakersun added the bug Something isn't working label Aug 26, 2023
@breakersun breakersun changed the title Windows 10 Not found Match Windows 10 Not found Match with Serial Aug 26, 2023
@github-actions github-actions bot changed the title Windows 10 Not found Match with Serial Windows 10 Not found Match with Serial (RDT-535) Aug 26, 2023
@breakersun
Copy link
Author

my test is pretty simple

import pytest

@pytest.mark.parametrize( 'port', ['COM11'], indirect=True,)

def test_echo_tcp(dut):
    dut.write(b'ATSS=START\r\n')
    dut.expect('[ATSS]:ATS', timeout=1)

DUT log is like this:


# [ATSS]:ATS:START

@breakersun
Copy link
Author

I also tried with ubuntu, and got the same error.

OS: Ubuntu 18.04
Python Version 3.10
Pytest Version 7.4.0
pytest-embedded Version 1.3.4

@igrr
Copy link
Member

igrr commented Aug 26, 2023

Could you try dut.expect_raw? Otherwise the match string is handled as a regular expression, and due to the square brackets it will have different meaning than the string you are trying to match.

@hfudev
Copy link
Member

hfudev commented Aug 27, 2023

Could you try dut.expect_raw? Otherwise the match string is handled as a regular expression, and due to the square brackets it will have different meaning than the string you are trying to match.

@breakersun Please try dut.expect_exact instead. The details and difference between expect and expect_exact are explained here

@breakersun
Copy link
Author

Thank you @hfudev dut.expect_exact works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants