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

Test fails on i586 #417

Open
sebix opened this issue Jan 25, 2022 · 7 comments
Open

Test fails on i586 #417

sebix opened this issue Jan 25, 2022 · 7 comments

Comments

@sebix
Copy link

sebix commented Jan 25, 2022

I'm packaging iredis on openSUSE and I see test failures on i586 while x64_86, aarch64 and ppc64 work fine:

[   90s] =================================== FAILURES ===================================
[   90s] ___________________________ test_peek_set_fetch_part ___________________________
[   90s] 
[   90s] iredis_client = <iredis.client.Client object at 0xf605ea60>
[   90s] clean_redis = Redis<ConnectionPool<Connection<host=localhost,port=6379,db=15>>>
[   90s] 
[   90s]     def test_peek_set_fetch_part(iredis_client, clean_redis):
[   90s]         clean_redis.sadd("myset", *[f"hello-{index}" for index in range(40)])
[   90s]         peek_result = list(iredis_client.do_peek("myset"))
[   90s]     
[   90s]         assert peek_result[0][0] == ("class:dockey", "key: ")
[   90s] >       assert peek_result[0][1][1].startswith("set (hashtable)  mem: 2")
[   90s] E       AssertionError: assert False
[   90s] E        +  where False = <built-in method startswith of str object at 0xf60d5920>('set (hashtable)  mem: 2')
[   90s] E        +    where <built-in method startswith of str object at 0xf60d5920> = 'set (hashtable)  mem: 1748 bytes, ttl: -1'.startswith
[   90s] 
[   90s] tests/unittests/test_client.py:331: AssertionError
[   90s] _______________________________ test_peek_stream _______________________________
[   90s] 
[   90s] iredis_client = <iredis.client.Client object at 0xf60bf430>
[   90s] clean_redis = Redis<ConnectionPool<Connection<host=localhost,port=6379,db=15>>>
[   90s] 
[   90s]     def test_peek_stream(iredis_client, clean_redis):
[   90s]         clean_redis.xadd("mystream", {"foo": "bar", "hello": "world"})
[   90s]         peek_result = list(iredis_client.do_peek("mystream"))
[   90s]     
[   90s]         assert peek_result[0][0] == ("class:dockey", "key: ")
[   90s] >       assert re.match(
[   90s]             r"stream \((stream|unknown)\)  mem: 6\d\d bytes, ttl: -1", peek_result[0][1][1]
[   90s]         )
[   90s] E       AssertionError: assert None
[   90s] E        +  where None = <function match at 0xf77ef4a8>('stream \\((stream|unknown)\\)  mem: 6\\d\\d bytes, ttl: -1', 'stream (stream)  mem: 387 bytes, ttl: -1')
[   90s] E        +    where <function match at 0xf77ef4a8> = re.match
[   90s] 
[   90s] tests/unittests/test_client.py:403: AssertionError
[   90s] ______________ test_timestamp_completer_humanize_time_completion _______________
[   90s] 
[   90s] fake_now = <MagicMock name='now' id='4129102000'>
[   90s] 
[   90s]     @patch("iredis.completers.pendulum.now")
[   90s]     def test_timestamp_completer_humanize_time_completion(fake_now):
[   90s]         fake_now.return_value = pendulum.from_timestamp(1578487013)
[   90s]         c = TimestampCompleter()
[   90s]     
[   90s]         fake_document = MagicMock()
[   90s]         fake_document.text = fake_document.text_before_cursor = "30"
[   90s]         completions = list(c.get_completions(fake_document, None))
[   90s]     
[   90s]         assert completions == [
[   90s]             Completion(
[   90s]                 text="1575895013000",
[   90s]                 start_position=-2,
[   90s]                 display=FormattedText([("", "1575895013000")]),
[   90s]                 display_meta="30 days ago (2019-12-09 12:36:53)",
[   90s]             ),
[   90s]             Completion(
[   90s]                 text="1578379013000",
[   90s]                 start_position=-2,
[   90s]                 display=FormattedText([("", "1578379013000")]),
[   90s]                 display_meta="30 hours ago (2020-01-07 06:36:53)",
[   90s]             ),
[   90s]             Completion(
[   90s]                 text="1578485213000",
[   90s]                 start_position=-2,
[   90s]                 display=FormattedText([("", "1578485213000")]),
[   90s]                 display_meta="30 minutes ago (2020-01-08 12:06:53)",
[   90s]             ),
[   90s]             Completion(
[   90s]                 text="1578486983000",
[   90s]                 start_position=-2,
[   90s]                 display=FormattedText([("", "1578486983000")]),
[   90s]                 display_meta="30 seconds ago (2020-01-08 12:36:23)",
[   90s]             ),
[   90s]         ]
[   90s]     
[   90s]         # No plural
[   90s]         fake_document.text = fake_document.text_before_cursor = "1"
[   90s]         completions = list(c.get_completions(fake_document, None))
[   90s]     
[   90s] >       assert completions == [
[   90s]             Completion(
[   90s]                 text="1546951013000",
[   90s]                 start_position=-1,
[   90s]                 display=FormattedText([("", "1546951013000")]),
[   90s]                 display_meta="1 year ago (2019-01-08 12:36:53)",
[   90s]             ),
[   90s]             Completion(
[   90s]                 text="1575808613000",
[   90s]                 start_position=-1,
[   90s]                 display=FormattedText([("", "1575808613000")]),
[   90s]                 display_meta="1 month ago (2019-12-08 12:36:53)",
[   90s]             ),
[   90s]             Completion(
[   90s]                 text="1578400613000",
[   90s]                 start_position=-1,
[   90s]                 display=FormattedText([("", "1578400613000")]),
[   90s]                 display_meta="1 day ago (2020-01-07 12:36:53)",
[   90s]             ),
[   90s]             Completion(
[   90s]                 text="1578483413000",
[   90s]                 start_position=-1,
[   90s]                 display=FormattedText([("", "1578483413000")]),
[   90s]                 display_meta="1 hour ago (2020-01-08 11:36:53)",
[   90s]             ),
[   90s]             Completion(
[   90s]                 text="1578486953000",
[   90s]                 start_position=-1,
[   90s]                 display=FormattedText([("", "1578486953000")]),
[   90s]                 display_meta="1 minute ago (2020-01-08 12:35:53)",
[   90s]             ),
[   90s]             Completion(
[   90s]                 text="1578487012000",
[   90s]                 start_position=-1,
[   90s]                 display=FormattedText([("", "1578487012000")]),
[   90s]                 display_meta="1 second ago (2020-01-08 12:36:52)",
[   90s]             ),
[   90s]         ]
[   90s] E       AssertionError: assert [Completion(t...000')])), ...] == [Completion(t...87012000')]))]
[   90s] E         Left contains one more item: Completion(text='1643072400000', start_position=-1, display=FormattedText([('', '1643072400000')]))
[   90s] E         Full diff:
[   90s] E           [
[   90s] E            Completion(text='1546951013000', start_position=-1, display=FormattedText([('', '1546951013000')])),
[   90s] E            Completion(text='1575808613000', start_position=-1, display=FormattedText([('', '1575808613000')])),
[   90s] E            Completion(text='1578400613000', start_position=-1, display=FormattedText([('', '1578400613000')])),
[   90s] E            Completion(text='1578483413000', start_position=-1, display=FormattedText([('', '1578483413000')])),...
[   90s] E         
[   90s] E         ...Full output truncated (5 lines hidden), use '-vv' to show
[   90s] 
[   90s] tests/unittests/test_completers.py:223: AssertionError

Do you know what might cause this?

@laixintao
Copy link
Owner

Hi @sebix, that's my fault, I believe it is caused by the memory sizes are different on i586 machines.

image

I will fix them by updating the test case to assert on regex instead of const memory number.

however, I am not sure why the test_timestamp_completer_humanize_time_completion failed. can you rerun this case with -vv and paste the result (I need the diff output mainly) here?

(btw do you know where can I get an i586 server for testing?)

@sebix
Copy link
Author

sebix commented Jan 26, 2022

Hi @sebix, that's my fault, I believe it is caused by the memory sizes are different on i586 machines.

image

I will fix them by updating the test case to assert on regex instead of const memory number.

Thanks!

however, I am not sure why the test_timestamp_completer_humanize_time_completion failed. can you rerun this case with -vv and paste the result (I need the diff output mainly) here?

Hope it helps:

[   74s] ______________ test_timestamp_completer_humanize_time_completion _______________
[   74s] 
[   74s] fake_now = <MagicMock name='now' id='4128701600'>
[   74s] 
[   74s]     @patch("iredis.completers.pendulum.now")
[   74s]     def test_timestamp_completer_humanize_time_completion(fake_now):
[   74s]         fake_now.return_value = pendulum.from_timestamp(1578487013)
[   74s]         c = TimestampCompleter()
[   74s]     
[   74s]         fake_document = MagicMock()
[   74s]         fake_document.text = fake_document.text_before_cursor = "30"
[   74s]         completions = list(c.get_completions(fake_document, None))
[   74s]     
[   74s]         assert completions == [
[   74s]             Completion(
[   74s]                 text="1575895013000",
[   74s]                 start_position=-2,
[   74s]                 display=FormattedText([("", "1575895013000")]),
[   74s]                 display_meta="30 days ago (2019-12-09 12:36:53)",
[   74s]             ),
[   74s]             Completion(
[   74s]                 text="1578379013000",
[   74s]                 start_position=-2,
[   74s]                 display=FormattedText([("", "1578379013000")]),
[   74s]                 display_meta="30 hours ago (2020-01-07 06:36:53)",
[   74s]             ),
[   74s]             Completion(
[   74s]                 text="1578485213000",
[   74s]                 start_position=-2,
[   74s]                 display=FormattedText([("", "1578485213000")]),
[   74s]                 display_meta="30 minutes ago (2020-01-08 12:06:53)",
[   74s]             ),
[   74s]             Completion(
[   74s]                 text="1578486983000",
[   74s]                 start_position=-2,
[   74s]                 display=FormattedText([("", "1578486983000")]),
[   74s]                 display_meta="30 seconds ago (2020-01-08 12:36:23)",
[   74s]             ),
[   74s]         ]
[   74s]     
[   74s]         # No plural
[   74s]         fake_document.text = fake_document.text_before_cursor = "1"
[   74s]         completions = list(c.get_completions(fake_document, None))
[   74s]     
[   74s] >       assert completions == [
[   74s]             Completion(
[   74s]                 text="1546951013000",
[   74s]                 start_position=-1,
[   74s]                 display=FormattedText([("", "1546951013000")]),
[   74s]                 display_meta="1 year ago (2019-01-08 12:36:53)",
[   74s]             ),
[   74s]             Completion(
[   74s]                 text="1575808613000",
[   74s]                 start_position=-1,
[   74s]                 display=FormattedText([("", "1575808613000")]),
[   74s]                 display_meta="1 month ago (2019-12-08 12:36:53)",
[   74s]             ),
[   74s]             Completion(
[   74s]                 text="1578400613000",
[   74s]                 start_position=-1,
[   74s]                 display=FormattedText([("", "1578400613000")]),
[   74s]                 display_meta="1 day ago (2020-01-07 12:36:53)",
[   74s]             ),
[   74s]             Completion(
[   74s]                 text="1578483413000",
[   74s]                 start_position=-1,
[   74s]                 display=FormattedText([("", "1578483413000")]),
[   74s]                 display_meta="1 hour ago (2020-01-08 11:36:53)",
[   74s]             ),
[   74s]             Completion(
[   74s]                 text="1578486953000",
[   74s]                 start_position=-1,
[   74s]                 display=FormattedText([("", "1578486953000")]),
[   74s]                 display_meta="1 minute ago (2020-01-08 12:35:53)",
[   74s]             ),
[   74s]             Completion(
[   74s]                 text="1578487012000",
[   74s]                 start_position=-1,
[   74s]                 display=FormattedText([("", "1578487012000")]),
[   74s]                 display_meta="1 second ago (2020-01-08 12:36:52)",
[   74s]             ),
[   74s]         ]
[   74s] E       AssertionError: assert [Completion(text='1546951013000', start_position=-1, display=FormattedText([('', '1546951013000')])),\n Completion(text='1575808613000', start_position=-1, display=FormattedText([('', '1575808613000')])),\n Completion(text='1578400613000', start_position=-1, display=FormattedText([('', '1578400613000')])),\n Completion(text='1578483413000', start_position=-1, display=FormattedText([('', '1578483413000')])),\n Completion(text='1578486953000', start_position=-1, display=FormattedText([('', '1578486953000')])),\n Completion(text='1578487012000', start_position=-1, display=FormattedText([('', '1578487012000')])),\n Completion(text='1643158800000', start_position=-1, display=FormattedText([('', '1643158800000')]))] == [Completion(text='1546951013000', start_position=-1, display=FormattedText([('', '1546951013000')])),\n Completion(text='1575808613000', start_position=-1, display=FormattedText([('', '1575808613000')])),\n Completion(text='1578400613000', start_position=-1, display=FormattedText([('', '1578400613000')])),\n Completion(text='1578483413000', start_position=-1, display=FormattedText([('', '1578483413000')])),\n Completion(text='1578486953000', start_position=-1, display=FormattedText([('', '1578486953000')])),\n Completion(text='1578487012000', start_position=-1, display=FormattedText([('', '1578487012000')]))]
[   74s] E         Left contains one more item: Completion(text='1643158800000', start_position=-1, display=FormattedText([('', '1643158800000')]))
[   74s] E         Full diff:
[   74s] E           [
[   74s] E            Completion(text='1546951013000', start_position=-1, display=FormattedText([('', '1546951013000')])),
[   74s] E            Completion(text='1575808613000', start_position=-1, display=FormattedText([('', '1575808613000')])),
[   74s] E            Completion(text='1578400613000', start_position=-1, display=FormattedText([('', '1578400613000')])),
[   74s] E            Completion(text='1578483413000', start_position=-1, display=FormattedText([('', '1578483413000')])),
[   74s] E            Completion(text='1578486953000', start_position=-1, display=FormattedText([('', '1578486953000')])),
[   74s] E            Completion(text='1578487012000', start_position=-1, display=FormattedText([('', '1578487012000')])),
[   74s] E         +  Completion(text='1643158800000', start_position=-1, display=FormattedText([('', '1643158800000')])),
[   74s] E           ]
[   74s] 
[   74s] tests/unittests/test_completers.py:223: AssertionError

(btw do you know where can I get an i586 server for testing?)

qemu? 😇

@laixintao
Copy link
Owner

I think those tests are ok to fail, the issue happens in test cases itself, not in code.

Sorry, we are celebrating Chinese New Year, I may need more time to fix this.

happy new year to you :)

@sebix
Copy link
Author

sebix commented Jan 28, 2022

Thanks for the response. I'll skip these tests for now.

happy new year to you :)

Thanks, you too!

@laixintao
Copy link
Owner

laixintao commented Jun 29, 2022

hi i have checked the qume https://manpages.debian.org/stretch/qemu-user/index.html @sebix

seems it doesn't support i586?

cloud you please give me some hints for where can i find some i586 servers for testing? or vms

@sebix
Copy link
Author

sebix commented Jun 29, 2022

hi i have checked the qume https://manpages.debian.org/stretch/qemu-user/index.html @sebix

seems it doesn't support i586?

Your link shows that is supports all kind of architectures. The machine type in use was i686.

Various hypervisors support 32 bit, like VirtualBox (select 32bit in the interface), docker (https://hub.docker.com/search?architecture=386&q=&operating_system=linux), kvm, libvirt etc.

However:
There have been various updates of dependencies since then, including python itself and I now also get errors for x86_64. Let's focus on them first.

@laixintao
Copy link
Owner

OK got it. I will fix it.

BTW, if the tests passed on i686 then it will pass on i586, right?

and what's your test env? you got a old machine or what :D

@laixintao laixintao reopened this Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants