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
*: Windows compatibility fixes #2264
Conversation
0abc89a
to
0aaf889
Compare
Codecov Report
@@ Coverage Diff @@
## master #2264 +/- ##
==========================================
+ Coverage 84.12% 84.97% +0.85%
==========================================
Files 305 307 +2
Lines 29383 31210 +1827
==========================================
+ Hits 24718 26521 +1803
+ Misses 3279 3261 -18
- Partials 1386 1428 +42
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make a single commit for all path/filepath things and then fix other things.
041b9bf
to
676401b
Compare
#2268 related to failing VM CLI tests. |
Problem: ``` --- FAIL: TestGetTimeoutContext (0.00s) --- FAIL: TestGetTimeoutContext/default (0.00s) options_test.go:44: Error Trace: options_test.go:44 Error: Should be true Test: TestGetTimeoutContext/default --- FAIL: TestGetTimeoutContext/set (0.00s) options_test.go:55: Error Trace: options_test.go:55 Error: Should be true Test: TestGetTimeoutContext/set FAIL ``` Solution: Allow deadline be equal to expected end time.
676401b
to
9025d0b
Compare
f8b688e
to
a2267aa
Compare
6f5b3c6
to
94e3c67
Compare
94e3c67
to
1dea861
Compare
if ($args[$i] -eq "node"){ | ||
Write-Host "=> Try to restore blocks before running node" | ||
if (($Env:ACC -ne $null) -and (Test-Path $Env:ACC -PathType Leaf)) { | ||
& $bin db restore -p --config-path /config -i $Env:ACC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we neet to unpack/unzip before trying to restore? IIUC, bash script for Ubuntu performs unzipping.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's relevant now, we've used ACC way back in Legacy days to prime the chain with 6K blocks generating some GAS (there was no GAS generated in the genesis block there), nowadays it's seems unnecessary. We can leave this as is for now.
@@ -0,0 +1,15 @@ | |||
#!C:\Program Files\PowerShell\7\pwsh.EXE -File |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, looks weird, but I'm not sure what's correct for Windows, so we can try going with this one until someone tells us what's more appropriate here.
if ($args[$i] -eq "node"){ | ||
Write-Host "=> Try to restore blocks before running node" | ||
if (($Env:ACC -ne $null) -and (Test-Path $Env:ACC -PathType Leaf)) { | ||
& $bin db restore -p --config-path /config -i $Env:ACC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it's relevant now, we've used ACC way back in Legacy days to prime the chain with 6K blocks generating some GAS (there was no GAS generated in the genesis block there), nowadays it's seems unnecessary. We can leave this as is for now.
Dockerfile.wsc
Outdated
COPY --from=builder /neo-go/config /config | ||
COPY --from=builder /neo-go/.docker/privnet-entrypoint.ps1 /usr/bin/privnet-entrypoint.ps1 | ||
COPY --from=builder /neo-go/bin/neo-go.exe /usr/bin/neo-go.exe | ||
# TODO: Windows Server doesn't have default crt, need to export certs from certmgr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But do we need to do this on Windows? I'm not sure where the client gets certificates from there.
e5d87b8
to
c222e20
Compare
Problem: ``` --- FAIL: TestHandleLoggingParams (0.02s) --- FAIL: TestHandleLoggingParams/default (0.00s) server_test.go:51: Error Trace: server_test.go:51 Error: Received unexpected error: couldn't open sink "C:\\Users\\Anna\\AppData\\Local\\Temp\\TestHandleLoggingParams226652490\\001/file.log": no sink found for scheme "c" Test: TestHandleLoggingParams/default --- FAIL: TestHandleLoggingParams/debug (0.00s) server_test.go:64: Error Trace: server_test.go:64 Error: Received unexpected error: couldn't open sink "C:\\Users\\Anna\\AppData\\Local\\Temp\\TestHandleLoggingParams226652490\\001/file.log": no sink found for scheme "c" Test: TestHandleLoggingParams/debug ``` Solution: Currently no solution is implemented, but we can use relative paths instead of absolute.
Problem: ``` --- FAIL: TestMemCachedPersist (0.07s) --- FAIL: TestMemCachedPersist/BoltDBStore (0.07s) testing.go:894: TempDir RemoveAll cleanup: remove C:\Users\Anna\AppData\Local\Temp\TestMemCachedPersist_BoltDBStore294966711\001\test_bolt_db: The process cannot access the file because it is being used by another process. ``` Solution: Release the resources occupied by the DB.
Problem: ``` --- FAIL: TestMakeDirForFile_HappyPath (0.01s) testing.go:894: TempDir RemoveAll cleanup: remove C:\Users\Anna\AppData\Local\Temp\TestMakeDirForFile_HappyPath402638411\001\testDir\testFile.test: The process cannot access the file because it is being used by another process. --- FAIL: TestMakeDirForFile_Negative (0.01s) testing.go:894: TempDir RemoveAll cleanup: remove C:\Users\Anna\AppData\Local\Temp\TestMakeDirForFile_Negative672737582\001\testFile.test: The process cannot access the file because it is being used by another process. FAIL ``` Solution: Release resources occupied by os.Create.
c222e20
to
a6c7d32
Compare
It is helpful if something goes wrong.
Solution: Use `file/filepath` package to construct expected path. This package is OS-aware, see golang/go#30616.
Problem: ``` --- FAIL: TestDumpDB (0.08s) --- FAIL: TestDumpDB/too_low_chain testing.go:894: TempDir RemoveAll cleanup: remove C:\Users\Anna\AppData\Local\Temp\TestDumpDB_too_low_chain357310492\001\chains\privnet\000001.log: The process cannot access the file because it is being used by another process. ``` Solution: Release resources occupied by the chain even on non-error command exit.
We're building inside Docker container, so we don't need golang to be installed on the host machine.
There's too much jobs in Tests workflow, so we can split them into several parts.
Also, remove Go setup from publishing jobs because we don't need Go on runner.
a6c7d32
to
5ef9f44
Compare
Make it work on Windows properly.
TODO: