Skip to content

Commit

Permalink
Fix scan timeout on Windows (#355)
Browse files Browse the repository at this point in the history
* Wait after scan failure during tests

* Use gross time for scan timestamps
  • Loading branch information
mattjala authored Apr 23, 2024
1 parent 01c02f7 commit b712200
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hsds/async_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
from .util.arrayUtil import getNumElements, bytesToArray
from .util.dsetUtil import getHyperslabSelection, getFilterOps, getChunkDims, getFilters
from .util.dsetUtil import getDatasetLayoutClass, getDatasetLayout, getShapeDims
from .util.timeUtil import getNow
from .util.storUtil import getStorKeys, putStorJSONObj, getStorJSONObj
from .util.storUtil import deleteStorObj, getStorBytes, isStorObj
from . import hsds_logger as log
from . import config
import time

# List all keys under given root and optionally update info.json
# Note: only works with schema v2 domains!
Expand Down Expand Up @@ -382,7 +382,7 @@ async def scanRoot(app, rootid, update=False, bucket=None):
results["logical_bytes"] = 0
results["checksums"] = {} # map of objid to checksums
results["bucket"] = bucket
results["scan_start"] = getNow(app)
results["scan_start"] = time.time()

app["scanRoot_results"] = results
app["scanRoot_keyset"] = set()
Expand Down Expand Up @@ -437,7 +437,7 @@ async def scanRoot(app, rootid, update=False, bucket=None):
# free up memory used by the checksums
del results["checksums"]

results["scan_complete"] = getNow(app)
results["scan_complete"] = time.time()

if update:
# write .info object back to S3
Expand Down
2 changes: 2 additions & 0 deletions tests/integ/value_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import numpy as np
import helper
import config
import time


class ValueTest(unittest.TestCase):
Expand Down Expand Up @@ -47,6 +48,7 @@ def checkVerbose(self, dset_id, headers=None, expected=None):
rsp = self.session.put(req, params=params, headers=headers)
if (rsp.status_code == 503):
# Retry
time.sleep(3)
continue
# should get a NO_CONTENT code
self.assertEqual(rsp.status_code, 204)
Expand Down

0 comments on commit b712200

Please sign in to comment.