mathics-core icon indicating copy to clipboard operation
mathics-core copied to clipboard

On aarch64 architecture, test_timeconstrained1from test_datentime.py fails

Open badshah400 opened this issue 4 years ago • 3 comments

When building mathics-core for openSUSE Tumbleweed, on the aarch64 architecture, the following test from version 4.0.0 fails (however, everything passes on x86_64 and i586). Any help resolving this would be appreciated.

[ 1876s] ____________________________ test_timeconstrained1 _____________________________
[ 1876s] 
[ 1876s]     def test_timeconstrained1():
[ 1876s]         #
[ 1876s]         str_expr1 = "a=1.; TimeConstrained[Do[Pause[.1];a=a+1,{1000}],1]"
[ 1876s]         result = evaluate(str_expr1)
[ 1876s]         str_expected = "$Aborted"
[ 1876s]         expected = evaluate(str_expected)
[ 1876s]         assert result == expected
[ 1876s]         time.sleep(1)
[ 1876s] >       assert evaluate("a").to_python() == 10
[ 1876s] E       assert 9.0 == 10
[ 1876s] E         +9.0
[ 1876s] E         -10
[ 1876s] 
[ 1876s] test_datentime.py:28: AssertionError

Thanks for your app.

badshah400 avatar Jan 30 '22 09:01 badshah400

@badshah400 - thanks for packing on openSUSE Tumbleweed. (Or at least trying.)

It looks like either TimeConstrained[] or Pause[] is failing.

If you change:

assert evaluate("a").to_python() == 10

to

print(time.localtime())
assert evaluate("a").to_python() == 10
pirnt(time.localtime())

is the elapsed time 9 seconds or 10?

rocky avatar Jan 30 '22 11:01 rocky

Sorry, this seems to happen randomly (heisenbug?) on this arch, but most times — including the last few times since reporting this issue — the test succeeds. I will have a more detailed log for you, along with the print statements, when this happens again but for now I suppose this issue may be closed.

badshah400 avatar Jan 30 '22 16:01 badshah400

The test might be flaky - there could be variation in Pause or TimedDelay which isn't accounted for.

rocky avatar Jan 30 '22 16:01 rocky