This repository was archived by the owner on Jan 23, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed
System.Diagnostics.Process/tests/System.Diagnostics.Process.Tests
System.IO.FileSystem.Watcher/tests Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ public void TestExitTime()
137
137
Assert . Throws < InvalidOperationException > ( ( ) => p . ExitTime ) ;
138
138
p . Kill ( ) ;
139
139
Assert . True ( p . WaitForExit ( WaitInMS ) ) ;
140
- Assert . True ( p . ExitTime . ToUniversalTime ( ) > timeBeforeProcessStart , "TestExitTime is incorrect." ) ;
140
+ Assert . True ( p . ExitTime . ToUniversalTime ( ) >= timeBeforeProcessStart , "TestExitTime is incorrect." ) ;
141
141
}
142
142
143
143
[ Fact ]
Original file line number Diff line number Diff line change 4
4
using System ;
5
5
using System . Collections . Generic ;
6
6
using System . IO ;
7
+ using System . Runtime . InteropServices ;
7
8
using System . Threading ;
8
9
using Xunit ;
9
10
@@ -101,7 +102,14 @@ public static void FileSystemWatcher_Created_Negative()
101
102
testFile . Flush ( ) ;
102
103
103
104
// renaming a directory
104
- testDir . Move ( testDir . Path + "_rename" ) ;
105
+ //
106
+ // We don't do this on Linux because depending on the timing of MOVED_FROM and MOVED_TO events,
107
+ // a rename can trigger delete + create as a deliberate handling of an edge case, and this
108
+ // test is checking that no create events are raised.
109
+ if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
110
+ {
111
+ testDir . Move ( testDir . Path + "_rename" ) ;
112
+ }
105
113
106
114
// deleting a file & directory by leaving the using block
107
115
}
Original file line number Diff line number Diff line change 3
3
4
4
using System ;
5
5
using System . IO ;
6
+ using System . Runtime . InteropServices ;
6
7
using System . Threading ;
7
8
using Xunit ;
8
9
@@ -70,9 +71,16 @@ public static void FileSystemWatcher_Deleted_Negative()
70
71
testFile . Flush ( ) ;
71
72
72
73
// renaming a directory
73
- testDir . Move ( testDir . Path + "_rename" ) ;
74
+ //
75
+ // We don't do this on Linux because depending on the timing of MOVED_FROM and MOVED_TO events,
76
+ // a rename can trigger delete + create as a deliberate handling of an edge case, and this
77
+ // test is checking that no delete events are raised.
78
+ if ( ! RuntimeInformation . IsOSPlatform ( OSPlatform . Linux ) )
79
+ {
80
+ testDir . Move ( testDir . Path + "_rename" ) ;
81
+ }
74
82
75
- Utility . ExpectNoEvent ( eventOccured , "changed " ) ;
83
+ Utility . ExpectNoEvent ( eventOccured , "deleted " ) ;
76
84
}
77
85
}
78
86
}
You can’t perform that action at this time.
0 commit comments