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

ci: Add windows test runner #2033

Merged
merged 12 commits into from
Nov 20, 2023

Conversation

AndrewSisley
Copy link
Contributor

@AndrewSisley AndrewSisley commented Nov 10, 2023

Relevant issue(s)

Resolves #2032

Description

Adds a windows test run to our test matrix.

Strongly suggest reviewing commit by commit - I've tried to explain why a bunch of stuff I had to change has been changed in the commit bodies.

Notes

  • The windows run is consistently slower than the mac/ubuntu ones, worsening our ci wait times
  • The below failure appears to happen occasionally:

error generating coverage report: writing D:\a\defradb\defradb\coverage\covmeta.776b203c66aeebb53e5712fcea6cd9a0: rename from D:\a\defradb\defradb\coverage\tmp.covmeta.776b203c66aeebb53e5712fcea6cd9a01700087389181284400 failed: rename D:\a\defradb\defradb\coverage\tmp.covmeta.776b203c66aeebb53e5712fcea6cd9a01700087389181284400 D:\a\defradb\defradb\coverage\covmeta.776b203c66aeebb53e5712fcea6cd9a0: Access is denied.

I can't spot anything obvious searching for this, and I've only seen it maybe twice/thrice out 30-40 runs, so at the moment I'm in favour of merging as-is, and then we can disable the cod-cov for windows runs whilst we fix/shelve it - but do let me know.

@AndrewSisley AndrewSisley changed the title WIP - Add windows and mac test runners ci: Add windows and mac test runners Nov 10, 2023
@AndrewSisley AndrewSisley changed the title ci: Add windows and mac test runners ci: Add windows test runner Nov 10, 2023
@fredcarle
Copy link
Collaborator

The errors in the tests seem to all be related to incorrect file paths. Should be easy to fix.

shahzadlone pushed a commit that referenced this pull request Nov 13, 2023
## Relevant issue(s)

Resolves #2034

## Description

Adds a mac (latest) test run to our test matrix.

This only use the lightest of configurations we have, I think this will
catch any/99% issues that we would otherwise miss.

Windows has been broken out to a different ticket, as quite a lot of
tests fail on windows and it will take more effort to get working:
#2033
@AndrewSisley AndrewSisley self-assigned this Nov 14, 2023
@AndrewSisley AndrewSisley force-pushed the 2032-windows-mac branch 6 times, most recently from 219d378 to 8a8c66c Compare November 14, 2023 19:02
@@ -8,6 +8,13 @@
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

// The badger GC seems to struggle a bit on windows, and this file rapidly spins up and discards
// databases resulting in out of memory and vlog cleanup issues, so we exclude this file from windows
// builds and and rely on the integration tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: "and and"

Copy link
Contributor Author

@AndrewSisley AndrewSisley Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers 😁

  • Fix typo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was able to remove this restriction instead

Copy link

codecov bot commented Nov 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bf63b0a) 73.78% compared to head (2bf25bb) 73.85%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2033      +/-   ##
===========================================
+ Coverage    73.78%   73.85%   +0.07%     
===========================================
  Files          248      248              
  Lines        24801    24808       +7     
===========================================
+ Hits         18298    18320      +22     
+ Misses        5236     5226      -10     
+ Partials      1267     1262       -5     
Flag Coverage Δ
all-tests 73.85% <100.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
http/errors.go 81.25% <100.00%> (+14.58%) ⬆️
http/server.go 93.79% <100.00%> (ø)

... and 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bf63b0a...2bf25bb. Read the comment docs.

@AndrewSisley AndrewSisley force-pushed the 2032-windows-mac branch 2 times, most recently from 456be88 to 63b9eb3 Compare November 15, 2023 22:33
@AndrewSisley AndrewSisley marked this pull request as ready for review November 15, 2023 23:23
@AndrewSisley AndrewSisley requested review from a team and islamaliev November 15, 2023 23:23
@AndrewSisley AndrewSisley added area/testing Related to any test or testing suite ci/build This is issue is about the build or CI system, and the administration of it. code quality Related to improving code quality labels Nov 15, 2023
@AndrewSisley AndrewSisley added this to the DefraDB v0.9 milestone Nov 15, 2023
The previous string asserted on was an os specific inner error that we wrapped with our own.  When running on windows a different string was returned causing the test to fail.  The test has been changed to assert on our custom error wrap, instead of the underlying message.
The previous string asserted on was an os specific inner error that we wrapped with our own.  When running on windows a different string was returned causing the test to fail.  The test has been changed to assert on our custom error wrap, instead of the underlying message.
And assert on our wrapped message instead of the inner.  This is changing now because the inner is OS specific and was different on windows compared to mac/linux.
By leaving them unclosed they and their resources will remain active until all tests in the package have completed, resulting in a much larger resource cost than is needed.  This set in particular resulted in the llvm race detector failing as the number of active routines exceeded the (hardcoded) limit of ~8100.
There is a race condition when closing the node, and the test looks odd - the name says it is expecting an error, yet it is not asserting for one, so I chose to remove it instead of removing the race.
Similar to the commit in the net package, this disposes of databases at the end of each test instead of keeping them all alive until the last test in the package completes (or the host runs out of memory, which is what the windows runner did).
Similar to the leaks in the net and db packages, this disposes of the test datstore at the end of each test.  Most tests in this file already did so, but a handful didn't.
These tests do not pass on windows as the log files are still open when the test runner tries to delete them.  I could not solve this quickly and it does not seem sensible to delay the windows test runner for the sake of a handful of log unit tests.
Credit goes to Fred for this fix.
Requested by Shahzad in a prior PR so that we are not reliant on github preserving it's current defaults.  I also find it handy as it makes changing it to false for temp testing a fair bit easier.
Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @fredcarle can comment regarding the removed net test, all rest LGTM

@AndrewSisley
Copy link
Contributor Author

Maybe @fredcarle can comment regarding the removed net test, all rest LGTM

This PR has idled for a while, can bring back/discuss the removed test post merge if need be.

@AndrewSisley AndrewSisley merged commit f65d7fa into sourcenetwork:develop Nov 20, 2023
31 checks passed
@AndrewSisley AndrewSisley deleted the 2032-windows-mac branch November 20, 2023 19:46
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Jan 22, 2024
## Relevant issue(s)

Resolves sourcenetwork#2032 

## Description

Adds a windows test run to our test matrix.
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#2034

## Description

Adds a mac (latest) test run to our test matrix.

This only use the lightest of configurations we have, I think this will
catch any/99% issues that we would otherwise miss.

Windows has been broken out to a different ticket, as quite a lot of
tests fail on windows and it will take more effort to get working:
sourcenetwork#2033
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#2032 

## Description

Adds a windows test run to our test matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing Related to any test or testing suite ci/build This is issue is about the build or CI system, and the administration of it. code quality Related to improving code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add windows runner
4 participants