I think what the OP means is do the contents of a chest get set once you enter a dungeon or will the content be random every time you open it (such as saving and reloading in front of the chest). From my experience with the game so far, it does seem that
some chests will have the same stuff in there. However, I have opened some chests multiple times and each time, there were different items (but those chests might be the chests outside in the world).
I believe it is as you open the chest. I have saved right before a master lock..(in case i used the 12 picks i had on me). I ended up picking the lock, saw the contents, and reloaded again to test this. New items were in the chest the 2nd time i picked