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

tdont_be_stupid.nim flaky test #10386

Closed
timotheecour opened this issue Jan 19, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@timotheecour
Copy link
Contributor

commented Jan 19, 2019

in an unrelated branch I had this failure in tests/parallel/tdont_be_stupid.nim (running in OSX, with nim cpp, in azure CI that I'm working on; but that shouldn't matter)

is the 100 millisecond gap not enough to guarantee that the results are ordered? seems fishy

2019-01-19T14:01:50.4596560Z Test "tests/parallel/tdont_be_stupid.nim" in category "parallel"
2019-01-19T14:01:50.4597490Z Failure: reOutputsDiffer
2019-01-19T14:01:50.4698480Z Expected:
2019-01-19T14:01:50.4699920Z 100
2019-01-19T14:01:50.4700390Z 200
2019-01-19T14:01:50.4700820Z 300
2019-01-19T14:01:50.4701220Z 400
2019-01-19T14:01:50.4702030Z
2019-01-19T14:01:50.4702920Z Gotten:
2019-01-19T14:01:50.4703790Z 100
2019-01-19T14:01:50.4804040Z 300
2019-01-19T14:01:50.4804900Z 200
2019-01-19T14:01:50.4805300Z 400
2019-01-19T14:01:50.4806620Z
discard """
output: '''
100
200
300
400
'''
"""

import threadpool, os

proc single(time: int) =
  sleep time
  echo time

proc sleepsort(nums: openArray[int]) =
  parallel:
    var i = 0
    while i <= len(nums) + -1:
      spawn single(nums[i])
      i += 1

sleepsort([400,100,300,200])

links

EDIT

I'm wondering whether this could be a bug specific to azure pipelines as I'm seeing some weird out of order stdout printing in another case, not yet sure though; note that that's the only failing test
see microsoft/azure-pipelines-yaml#106 (but really not sure it's related)
unrelated after I investigated that other issue

@Araq

This comment has been minimized.

Copy link
Member

commented Jan 21, 2019

Throw this test away.

@narimiran narimiran closed this in f1a841c Jan 23, 2019

ThomasTJdev added a commit to ThomasTJdev/Nim that referenced this issue Jan 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.