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

Library hangs if you stub the system time #129

Closed
kevinburkeshyp opened this issue Mar 14, 2016 · 1 comment
Closed

Library hangs if you stub the system time #129

kevinburkeshyp opened this issue Mar 14, 2016 · 1 comment

Comments

@kevinburkeshyp
Copy link

Occasionally in tests we stub the system time using sinon.useFakeTimers. This causes the fast-csv library to hang before writing any rows.

It looks like the problem is here: https://github.com/C2FO/fast-csv/blob/master/lib/extended.js#L16-L23. This library is not the only library with this problem: sinonjs/sinon#960

I'm not completely sure why this is happening, or necessary, though it's certainly unexpected that stubbing the system time would cause CSV writing to fail. Debugging errors like this is particularly frustrating due to the lack of stack traces or useful information about running threads of execution while Javascript is executing.

@dustinsmith1024
Copy link
Contributor

We use https://github.com/vesln/timekeeper for testing internally. You might try using it instead of Sinon's built in time traveling.

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