HDFGroup / hsds

Cloud-native, service based access to HDF data
https://www.hdfgroup.org/solutions/hdf-kita/
Apache License 2.0
125 stars 52 forks source link

Fix 409 Conflict in domain test on Windows #354

Closed mattjala closed 2 months ago

mattjala commented 2 months ago

testCreateDomainNodeIds sometimes gets an HTTPConflict trying to create its domain. This is because the domain helpers generate a domain name based on the current timestamp and the given domain name. Both this test and testCreateDomain use the same given domain name of newdomain.h6, and because of Windows' low time resolution, sometimes both domains are created at the same timestamp and have a name conflict.

This PR changes the name of the domain in testCreateDomainNodeIds to avoid the conflict regardless of timestamp.

Resolves #353

jreadey commented 2 months ago

Curious - why did this only crop up on Windows?

mattjala commented 2 months ago

Curious - why did this only crop up on Windows?

The root issue is the same as with most of the other Windows issues recently: time.time() only has a resolution of about 16ms, so it's not uncommon for two objects to be created within the same <16 ms period of time and be given the exact same timestamp.