{"action":"created","issue":{"url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/135","labels_url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/135/comments","events_url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/135/events","html_url":"https://github.com/unexpectedjs/unexpected/issues/135","id":66134776,"number":135,"title":"v7: Race condition with rejected Promise","user":{"login":"papandreou","id":373545,"avatar_url":"https://avatars.githubusercontent.com/u/373545?v=3","gravatar_id":"","url":"https://api.github.com/users/papandreou","html_url":"https://github.com/papandreou","followers_url":"https://api.github.com/users/papandreou/followers","following_url":"https://api.github.com/users/papandreou/following{/other_user}","gists_url":"https://api.github.com/users/papandreou/gists{/gist_id}","starred_url":"https://api.github.com/users/papandreou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/papandreou/subscriptions","organizations_url":"https://api.github.com/users/papandreou/orgs","repos_url":"https://api.github.com/users/papandreou/repos","events_url":"https://api.github.com/users/papandreou/events{/privacy}","received_events_url":"https://api.github.com/users/papandreou/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-04-03T12:11:52Z","updated_at":"2015-04-04T09:28:22Z","closed_at":"2015-04-04T09:24:28Z","body":"There is a test in unexpected-promise that fails about 1 out of 10 times for some odd reason. I think it might be due to a bug or quirk with the promise implementation. It fails more often when running coverage (`npm run coverage`), so it appears to be highly timing sensitive.\r\n\r\nWhen the test is singled out via `mocha -g` it fails every time:\r\n\r\n```\r\nandreas@andreas-ThinkPad-T500:~/work/unexpected-promise$ mocha -g \"unexpected-promise \\\"when resolved\\\" adverbial assertion should fail when the next assertion fails\"\r\n\r\n\r\n  unexpected-promise\r\n    \"when resolved\" adverbial assertion\r\n      1) should fail when the next assertion fails\r\n\r\n\r\n  0 passing (66ms)\r\n  1 failing\r\n\r\n  1) unexpected-promise \"when resolved\" adverbial assertion should fail when the next assertion fails:\r\n     Error: \r\nexpected Promise\r\nwhen rejected to have message 'expected Promise when resolved to satisfy { foo: \\'baz\\' }\\n  expected { foo: \\'bar\\' } to satisfy { foo: \\'baz\\' }\\n\\n  {\\n    foo: \\'bar\\' // should equal \\'baz\\'\\n               // -bar\\n               // +baz\\n  }'\r\n  expected\r\n  Error({\r\n    message: '\\n\\u001b[31m\\u001b[1mexpected\\u001b[22m\\u001b[39m \\u001b[35mPromise\\u001b[39m \\u001b[31m\\u001b[1mwhen resolved\\u001b[22m\\u001b[39m \\u001b[31m\\u001b[1mto satisfy\\u001b[22m\\u001b[39m { \\u001b[90m\\u001b[38;5;242mfoo\\u001b[39m: \\u001b[36m\\'baz\\'\\u001b[39m }\\n  \\u001b[31m\\u001b[1mexpected\\u001b[22m\\u001b[39m { \\u001b[90m\\u001b[38;5;242mfoo\\u001b[39m: \\u001b[36m\\'bar\\'\\u001b[39m } \\u001b[31m\\u001b[1mto satisfy\\u001b[22m\\u001b[39m { \\u001b[90m\\u001b[38;5;242mfoo\\u001b[39m: \\u001b[36m\\'baz\\'\\u001b[39m }\\n\\n  {\\n    \\u001b[90m\\u001b[38;5;242mfoo\\u001b[39m: \\u001b[36m\\'bar\\'\\u001b[39m \\u001b[31m\\u001b[1m//\\u001b[22m\\u001b[39m \\u001b[31m\\u001b[1mshould equal\\u001b[22m\\u001b[39m \\u001b[36m\\'baz\\'\\u001b[39m\\n  }',\r\n    _isUnexpected: true,\r\n    output: MagicPen({\r\n      styles: {\r\n        jsBoolean: ...,\r\n        jsNumber: ...,\r\n        error: ...,\r\n        success: ...,\r\n        diffAddedLine: ...,\r\n        diffAddedHighlight: ...,\r\n        diffAddedSpecialChar: ...,\r\n        diffRemovedLine: ...,\r\n        diffRemovedHighlight: ...,\r\n        diffRemovedSpecialChar: ...,\r\n        jsComment: ...,\r\n        jsFunctionName: ...,\r\n        jsKeyword: ...,\r\n        jsPrimitive: ...,\r\n        jsRegexp: ...,\r\n        jsString: ...,\r\n        jsKey: ...,\r\n        key: ...,\r\n        code: ...,\r\n        annotationBlock: ...,\r\n        shouldEqualError: ...\r\n      },\r\n      indentationLevel: 0,\r\n      output: [...],\r\n      installedPlugins: [],\r\n      _themes: { text: ..., html: ..., ansi: ..., coloredConsole: ... }\r\n    }),\r\n    _hasSerializedErrorMessage: true\r\n  })\r\n  to have message 'expected Promise when resolved to satisfy { foo: \\'baz\\' }\\n  expected { foo: \\'bar\\' } to satisfy { foo: \\'baz\\' }\\n\\n  {\\n    foo: \\'bar\\' // should equal \\'baz\\'\\n               // -bar\\n               // +baz\\n  }'\r\n    expected 'expected Promise when resolved to satisfy { foo: \\'baz\\' }\\n  expected { foo: \\'bar\\' } to satisfy { foo: \\'baz\\' }\\n\\n  {\\n    foo: \\'bar\\' // should equal \\'baz\\'\\n  }'\r\n    to equal 'expected Promise when resolved to satisfy { foo: \\'baz\\' }\\n  expected { foo: \\'bar\\' } to satisfy { foo: \\'baz\\' }\\n\\n  {\\n    foo: \\'bar\\' // should equal \\'baz\\'\\n               // -bar\\n               // +baz\\n  }'\r\n\r\n     expected Promise when resolved to satisfy { foo: 'baz' }\r\n       expected { foo: 'bar' } to satisfy { foo: 'baz' }\r\n\r\n       {\r\n         foo: 'bar' // should equal 'baz'\r\n    +               // -bar\r\n    +               // +baz\r\n       }\r\n```\r\n\r\nSwitching to the bastardized bluebird used by Unexpected itself did not help."},"comment":{"url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/comments/89536914","html_url":"https://github.com/unexpectedjs/unexpected/issues/135#issuecomment-89536914","issue_url":"https://api.github.com/repos/unexpectedjs/unexpected/issues/135","id":89536914,"user":{"login":"sunesimonsen","id":90802,"avatar_url":"https://avatars.githubusercontent.com/u/90802?v=3","gravatar_id":"","url":"https://api.github.com/users/sunesimonsen","html_url":"https://github.com/sunesimonsen","followers_url":"https://api.github.com/users/sunesimonsen/followers","following_url":"https://api.github.com/users/sunesimonsen/following{/other_user}","gists_url":"https://api.github.com/users/sunesimonsen/gists{/gist_id}","starred_url":"https://api.github.com/users/sunesimonsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sunesimonsen/subscriptions","organizations_url":"https://api.github.com/users/sunesimonsen/orgs","repos_url":"https://api.github.com/users/sunesimonsen/repos","events_url":"https://api.github.com/users/sunesimonsen/events{/privacy}","received_events_url":"https://api.github.com/users/sunesimonsen/received_events","type":"User","site_admin":false},"created_at":"2015-04-04T09:28:22Z","updated_at":"2015-04-04T09:28:22Z","body":"Could you test it with unexpected-messy - that is probably easier."}}