480 Commits

Author SHA1 Message Date
Eric
034bbc7672
undo changes done for CI debugging 2025-06-04 15:50:47 +10:00
Eric
b20b12a232
Back off port inc in the hopes that this is causing issues with CI 2025-06-04 15:49:17 +10:00
Eric
a7fd01c3de
formatting
trying to make nph happy
2025-06-04 15:49:17 +10:00
Eric
910af93dab
formatting 2025-06-04 15:49:16 +10:00
Eric
985d1243be
clean up 2025-06-04 15:49:16 +10:00
Eric
d2be32f7b0
use tracked futures for showContinuousStatusUpdates 2025-06-04 15:49:16 +10:00
Eric
d0c3da654c
formatting 2025-06-04 15:49:16 +10:00
Eric
13ad7d0014
format info blurbs 2025-06-04 15:49:15 +10:00
Eric
034a6ade74
allow test parameters to be set from make testIntegration command 2025-06-04 15:49:15 +10:00
Eric
3564b7afeb
DIsable continuous updates by default (for CI) 2025-06-04 15:47:41 +10:00
Eric
5f3a2b70f1
fix rebase, formatting 2025-06-04 15:47:41 +10:00
Eric
528f27245d
fix rebase 2025-06-04 15:47:40 +10:00
Eric
f1c5daad9d
Use absolute path for binary when checking for existence 2025-06-04 15:47:40 +10:00
Eric
6987aefc84
fail early with message when hardhat binary not found
# Conflicts:
#	tests/integration/hardhatprocess.nim
2025-06-04 15:47:40 +10:00
Eric
7a855f0f2b
remove unneeded sleep 2025-06-04 15:47:40 +10:00
Eric
e35fe07c2a
make onoutputline callback gcsafe 2025-06-04 15:47:40 +10:00
Eric
0ab4ec2678
increase port distance per test run 2025-06-04 15:47:40 +10:00
Eric
44537f8285
add constructor param for continuous status update in terminal
# Conflicts:
#	tests/testIntegration.nim
2025-06-04 15:47:40 +10:00
Eric
b58d4c6aef
fix nodeprocess not exiting 2025-06-04 15:47:39 +10:00
Eric
a83142bfc2
ensure timeouts work
Work around the AsyncProcess timeout not working correctly
2025-06-04 15:47:39 +10:00
Eric
7dfd5e5f3e
continually show test status updates
allows user to know which tests are still running
2025-06-04 15:47:39 +10:00
Eric
77b0bbc11e
cleanup
# Conflicts:
#	tests/testIntegration.nim
2025-06-04 15:47:39 +10:00
Eric
0c55913ff9
lock hardhat start to avoid intermittent start failures 2025-06-04 15:47:39 +10:00
Eric
aa1a52eb4f
clean up 2025-06-04 15:47:39 +10:00
Eric
f3f9e6c791
print hardhat testmanager errors and hardhat stdout when there is an error starting hardhat 2025-06-04 15:47:38 +10:00
Eric
90bb75bb85
hang manager off IntegrationTest, cleanup
- add a TestManager property to IntegrationTest, so manager does not need to be passed into all functions
- cleanup:
  - remove unneeded stopHardhat function
  - add hardhat instance to manager outside of startHardhat
2025-06-04 15:47:38 +10:00
Eric
3e29d414d2
pass hardhat port to ethersuite
# Conflicts:
#	tests/ethertest.nim
2025-06-04 15:47:37 +10:00
Eric
d753a517d9
reinstate removed types 2025-06-04 15:46:34 +10:00
Eric
d6e9162f48
Add additional logging info print outs
# Conflicts:
#	tests/integration/testcli.nim
2025-06-04 15:46:34 +10:00
Eric
fe77dd25e5
expect process exit code
prevents showing error in the logs when an expected process exit code is encountered

# Conflicts:
#	tests/integration/testcli.nim
2025-06-04 15:46:33 +10:00
Eric
f7a3904774
stop hardhat and show logs
# Conflicts:
#	tests/integration/hardhatprocess.nim
2025-06-04 15:46:33 +10:00
Eric
10eda3a0e9
default test name to the filename of the integration test
# Conflicts:
#	tests/testIntegration.nim
2025-06-04 15:46:33 +10:00
Eric
9ffb0f41ad
print start/finish stderr/stdout markers
# Conflicts:
#	tests/testIntegration.nim
2025-06-04 15:46:33 +10:00
Eric
b80b14480a
clean up 2025-06-04 15:46:33 +10:00
Eric
15462ce0f0
stdout formatting for test results
# Conflicts:
#	tests/testIntegration.nim
2025-06-04 15:46:33 +10:00
Eric
2ed16a2e86
prevent errors during node shutdown 2025-06-04 15:46:32 +10:00
Eric
50cf49aebb
test summary formatting 2025-06-04 15:46:32 +10:00
Eric
739ff2fe88
parallel tests running
- need to test with longer tests to ensure the parallelisation is truly happening
- is the +10 hardhat port needed?
- try with more integration tests

# Conflicts:
#	tests/integration/hardhatprocess.nim
#	tests/integration/multinodes.nim
#	tests/integration/testcli.nim
#	tests/testIntegration.nim
2025-06-04 15:46:32 +10:00
Arnaud
45ade0e3c1
chore(marketplace): use canMarkProofAsMissing (#1188)
* Add canProofBeMarkedAsMissing

* Add more tests

* Update contracts submodule
2025-06-03 09:08:57 +00:00
Arnaud
ca869f6dce
fix(availabilities): use totalRemainingCollateral instead of totalCollateral for comparaison (#1229)
* Use totalRemainingCollateral instead of totalCollateral to compare the availability changes

* Update test to use totalRemainingCollateral instead of totalCollateral when testing OnAvailabilitySaved

* Reduce poll interval

* Fix flaky test

* Fix format
2025-06-02 16:47:12 +00:00
Giuliano Mega
d59c5b023c
chore: bump Nim to 2.2.4 (#1242)
* chore: bump Nim to 2.2.4

* fix: resolve symbol ambiguity and drop auto type

* fix: use reference to task instead of pointer or the compiler will deallocate `task` before the encoding/decoding is done

* fix: convention that maxCollateralPerByte equals totalRemainingCollateral when freeSize is 0 to avoid DivByZeroDefect

* fix: bump compiler version in CI pipeline as well
2025-05-29 16:37:38 -07:00
Arnaud
28a83db69e
chore: returns the collateral when a slot is reserved but not filled (#1216)
* Change token allowance method because increaseAllowance does not exist anymore

* Returns collateral when a reservation is deleted and not only a slot is filled

* Remove the returnedCollateral when the slot is not filled by the host

* Add returnedCollateral when the sale is ignored

* Add returnsCollateral variable for ignored state

* Rebase the contracts submodule on the master

* Add integration test

* Fix duration

* Remove unnecessary teardown function

* Remove misleading comment

* Get returned collateral from the request

* Enable logs to debug on CI

* Fix test

* Increase test timeout

* Fix typo

* Fix rebase
2025-05-29 14:47:37 +00:00
Arnaud
c689542579
fix: sales cleanup cancellation (#1234)
* fix(sales): handle cancellation of slot cleanup

Ensures that processing slots from the slot queue
continues even when cleanup of a slot is cancelled.

Co-Authored-By: Eric <5089238+emizzle@users.noreply.github.com>

* chore(reservations): add more `raises` annotations

* Fix cleanup cancellation

* Add remove-agent to trackedfutures instead of the cleanup function

* Increase the timeout to match the request expiry

* Enable logs to debug on CI

* Remove useless except and do not return when add item back to slot queue fails

* Reduce poll interval to detect sale cancelled state

* Avoid cancelling cleanup routine

* Do not cancel creating reservation in order to avoid inconsistent state

* Remove useless try except

---------

Co-authored-by: Mark Spanbroek <mark@spanbroek.net>
Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
2025-05-29 06:57:05 +00:00
markspanbroek
25a8077e80
fix(integration): fix api validation test (#1201)
* integration: shutdown codex node at end of test

On Windows the codex node did not shut down properly after this test
finished.

* contracts: fix flaky test
2025-05-26 16:49:53 +00:00
Arnaud
f7d06cd0e8
chore(marketplace): switch to websocket (#1166)
* Switch to websocket

* Create resubscribe future

* Resubscribe websocket events after 5 minutes

* Remove the subscribe workaround and use define the resubscribe symbol

* Use localhost for ws url

* Define 240 seconds for resubscription interval

* Ensute that updates are sync when using ws
2025-05-23 14:13:19 +00:00
Marcin Czenko
748830570a
checked exceptions in stores (#1179)
* checked exceptions in stores

* makes asynciter as much exception safe as it gets

* introduce "SafeAsyncIter" that uses Results and limits exceptions to cancellations

* adds {.push raises: [].} to errors

* uses SafeAsyncIter in "listBlocks" and in "getBlockExpirations"

* simplifies safeasynciter (magic of auto)

* gets rid of ugly casts

* tiny fix in hte way we create raising futures in tests of safeasynciter

* Removes two more casts caused by using checked exceptions

* adds an extended explanation of one more complex SafeAsyncIter test

* adds missing "finishOnErr" param in slice constructor of SafeAsyncIter

* better fix for "Error: Exception can raise an unlisted exception: Exception" error.

---------

Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2025-05-21 21:17:04 +00:00
markspanbroek
bde98738c2
fix(slotqueue): simplify slot queue workers (#1224)
* fix(slotqueue): simplify slot queue workers

- worker is now just an async running loop
- instead of passing a "done" Future, use an
  AsyncEvent to signal completion

* chore(slotqueue): address review comments

Co-Authored-By: Eric <5089238+emizzle@users.noreply.github.com>
Co-Authored-By: Dmitriy Ryajov <dryajov@gmail.com>

---------

Co-authored-by: Eric <5089238+emizzle@users.noreply.github.com>
Co-authored-by: Dmitriy Ryajov <dryajov@gmail.com>
2025-05-15 13:02:04 +00:00
Adam Uhlíř
f144099377
fix(api): availability creation validation (#1212) 2025-05-14 08:46:16 +00:00
Eric
0f152d333c
chore: bump contracts to master (#1197)
Bump contracts to master branch.

There was a change that allowed hardhat to have multiple blocks with the same timestamp, so this needed to be reflected in two tests.
2025-04-17 06:13:43 +00:00
Marcin Czenko
5ec3b2b027
make sure we do not call "get" on unverified Result while fetching in batches (#1169)
* makes sure we do not call "get" on unverified result

* make handling of failed blocks in fetchBatched even more explicit

* simplifies allFinishedValues and makes it independent from allFinishedFailed

* only sleep if not iter.finished in fetchBatched
2025-03-31 04:57:55 +00:00