1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

log job status each sec

This commit is contained in:
Bogdan Fazakas 2022-08-23 10:50:32 +03:00
parent 5d4c07a7f8
commit c7e402e71e

View File

@ -498,28 +498,30 @@ describe('Simple compute tests', async () => {
assert(computeJobs, 'Cannot start compute job') assert(computeJobs, 'Cannot start compute job')
computeJobId = computeJobs[0].jobId computeJobId = computeJobs[0].jobId
await sleep(5000) for (let index = 0; index < 10; index++) {
const jobStatus = (await ProviderInstance.computeStatus( await sleep(1000)
providerUrl, const jobStatus = (await ProviderInstance.computeStatus(
consumerAccount, providerUrl,
computeJobId, consumerAccount,
resolvedDdoWith1mTimeout.id computeJobId,
)) as ComputeJob resolvedDdoWith1mTimeout.id
console.log('job status after 1 sec', jobStatus) )) as ComputeJob
console.log('job status after 1 sec', jobStatus)
}
}) })
it('should restart a computeJob without paying anything, because order is valid and providerFees are still valid', async () => { it('should restart a computeJob without paying anything, because order is valid and providerFees are still valid', async () => {
// wait 1 min time so the other compute job finishes his job // wait 1 min time so the other compute job finishes his job
await sleep(10000) for (let index = 0; index < 15; index++) {
await sleep(1000)
const jobStatus = (await ProviderInstance.computeStatus( const jobStatus = (await ProviderInstance.computeStatus(
providerUrl, providerUrl,
consumerAccount, consumerAccount,
computeJobId, computeJobId,
resolvedDdoWith1mTimeout.id resolvedDdoWith1mTimeout.id
)) as ComputeJob )) as ComputeJob
console.log('log job status again: ', jobStatus)
console.log('job status after 15 sec', jobStatus) }
// we choose the free env // we choose the free env
const computeEnv = computeEnvs.find((ce) => ce.priceMin === 0) const computeEnv = computeEnvs.find((ce) => ce.priceMin === 0)