On aarch64 architecture, test_timeconstrained1from test_datentime.py fails
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 - 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?
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.
The test might be flaky - there could be variation in Pause or TimedDelay which isn't accounted for.