Details
Description
The underlying issue is that the test is assuming that after the refineShardKey command the persistent cached metadata on the shards is updated. However, the test is not forcing a refresh so those changes are not visible.
In order to fix that we could add an explicit refresh of the collection before checking that the timestamp in config.cache.collections (shard) is the same as in config.collections (config server).