microsoft / testfx

MSTest framework and adapter
MIT License
716 stars 253 forks source link

`--diagnostic`-log not sort-by-name friendly #3751

Open AliveDevil opened 1 week ago

AliveDevil commented 1 week ago

Describe the bug

The --diagnostic-option creates files with an opaque, non-modified date sorting friendly file name.

Steps To Reproduce

  1. Run multiple successive tests with --diagnostic, when process Ids are recycled, the name sorting option is useless.

Expected behavior

Some name sorting friendly file prefix (i.e. log_yyyymmddThhmmss_ProcessId.diag).

Actual behavior

Screenshot_20240903_125137

log_09030958760.diag: 11:47
log_09031011248.diag: 12:30
log_09031028245.diag: 12:34
log_09031043246.diag: 12:17
log_09031043969.diag: 12:10
log_09031045242.diag: 12:34
log_09031055355.diag: 12:09
nohwnd commented 1 week ago

Adding to next milestone, looks like low hanging fruit, and I don't think change of name in diag log should be considered a breaking change.

MarcoRossignoli commented 1 week ago

? Some name sorting friendly file prefix (i.e. log_yyyymmddThhmmss_ProcessId.diag)

Fine to me a format like that, keeping in mind that you should not take the "process_id" as guarantee for nothing, that id can be reused for different processes, maybe we can simply have time ordering, anyway today we have a retry loop if the file is already taken by someone else in the same folder so the order will be preserved and the pid says nothing about the nature of the file, maybe we can add the tfm the make easy to read it.