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

Tests error on Windows #241

Closed
vitaly-t opened this issue Aug 4, 2024 · 8 comments · Fixed by #242
Closed

Tests error on Windows #241

vitaly-t opened this issue Aug 4, 2024 · 8 comments · Fixed by #242
Assignees
Labels

Comments

@vitaly-t
Copy link
Owner

vitaly-t commented Aug 4, 2024

Cannot run tests, after the DEV Dependencies PR:

image

Running npm test produces the above error for me. Could be because I use Windows 11 here? I haven't tried it on Mac yet, will do a little later, if needed. It reproduces using NodeJS 18, 20 and 22.

P.S. I did remove all installed dependencies and reinstalled everything.

@vitaly-t vitaly-t added help wanted Extra attention is needed tests labels Aug 4, 2024
@vitaly-t
Copy link
Owner Author

vitaly-t commented Aug 4, 2024

So I have done some more testing, including on Mac, and I can now confirm that the issue is Windows-specific. I had no issues whatsoever on Mac. Specifically, it is npm run test:js that's failing, because of some c8-related issues.

Unfortunately, Windows 11 is my main rig here, so I need to figure it out. Any help is much appreciated!

@RebeccaStevens

@vitaly-t
Copy link
Owner Author

vitaly-t commented Aug 4, 2024

If I set the full path to the c8 module like this:

"test:js": "cross-env TSX_TSCONFIG_PATH=tsconfig.test.json NODE_OPTIONS='--import tsx' node_modules/c8/bin/c8 mocha 'test/**/*.spec.ts'"

Then I am getting this:

image

@RebeccaStevens
Copy link
Collaborator

Got a potential fix. Weird thing is that one of the tests are failing for me now on windows.

@vitaly-t
Copy link
Owner Author

vitaly-t commented Aug 4, 2024

That PR does work for me!!! :)

I also see some test issues, but only sometimes, that's because there are some race-condition tests that were tuned to pass under the current test framework. I will just need to fine-tune them a little now that the test framework is different, and it may effect timings for some race tests.

@RebeccaStevens
Copy link
Collaborator

Figured it out. It's a timing bug.

@RebeccaStevens
Copy link
Collaborator

Actually, maybe not a bug as such. It looks more intentional so I guess an issue with the test.

@vitaly-t
Copy link
Owner Author

vitaly-t commented Aug 4, 2024

Values for the test were tuned to pass under the current test framework. But since it is a race-condition test, timings change when the test framework changes, so needs to be updated to pass both on Linux and Windows. That's not something to worry about, I can update any such troubling test ;)

@RebeccaStevens
Copy link
Collaborator

Alright, I'll leave that all to you. I did make an issue though #243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants