24 Commits
Author SHA1 Message Date
Alexis Christoforides 449e36638f [corlib] Import FileSystemInfo and family from CoreFX (#11342)
Includes the following from System.IO:

* FileSystemInfo
* FileInfo
* DirectoryInfo
* Directory
* FileSystem
* Path `Join()` Span API

and all of System.IO.Enumeration namespace.

Adds about 1600 System.IO tests

Behavior changes:
* `File.Replace` now replaces files even if they are read-only (using the `rename` syscall on Unix)
* Directory enumeration is no longer stable in the way that many Mono tests expect
* Some changes in when/whether some representations of directories contain a trailing separator character
* Changes in which exceptions are thrown (sometimes these are platform-dependent on CoreFX)

Issues:
* https://github.com/dotnet/corefx/issues/33486
* https://github.com/dotnet/corefx/issues/33490

Part of #7246
2018-12-07 15:02:23 +01:00
Alexander Köplinger 6caf00b09c [bcl] Remove AssertExtensions helper classes (#5828)
* [bcl] Remove AssertExtensions helper classes

Since we're on nunitlite now we can use the proper `Assert.Throws<>()`
instead and remove the helper class (which we actually duplicated!)
2017-10-19 12:38:33 +02:00
Alexander Köplinger a4f6ac0700 [System.Runtime.Caching] Make TestExpiredGetValues test more reliable
It failed twice on Jenkins over the weekend:

```
Test Case Failures:
1) MonoTests.System.Runtime.Caching.MemoryCacheTest.TestExpiredGetValues :   #EGV4
  Expected: 0
  But was:  9

at MonoTests.System.Runtime.Caching.MemoryCacheTest.TestExpiredGetValues () [0x0012b] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/System.Runtime.Caching/Test/System.Runtime.Caching/MemoryCacheTest.cs:1304
```

We're sleeping just as long as the expiry time of the cache items (1s) which might not be enough.
Bumping the sleep time should fix this.
2016-02-08 17:05:07 +01:00
Alexander Köplinger b03e606287 Remove ChangeLog files from the repo
They weren't updated in the last 6 years and aren't helpful anymore (e.g. by causing unrelated matches during git grep searches).
2016-01-29 19:17:06 +01:00
Alexander Köplinger 39d172e190 [System.Runtime.Caching] Bump timeout in tests to make them more reliable
Failed on Jenkins on ARM today:

```
Tests run: 38, Failures: 1, Not run: 0, Time: 32.132 seconds

Test Case Failures:
1) MonoTests.System.Runtime.Caching.MemoryCacheTest.TimedExpiration :   #A4-4
  Expected: not null
  But was:  null

at MonoTests.System.Runtime.Caching.MemoryCacheTest.TimedExpiration () [0x002b6] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/System.Runtime.Caching/Test/System.Runtime.Caching/MemoryCacheTest.cs:902
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /media/ssd/jenkins/workspace/test-mono-mainline/label/debian-armel/mcs/class/corlib/System.Reflection/MonoMethod.cs:295
```

100ms could be too short, bumping the timeout should make it more reliable on the slower ARM machines.
2016-01-27 12:29:45 +01:00
Marek Safar 5b0e77be18 [System.Runtime.Caching] Update test due to .net fixes 2015-10-20 11:47:06 +02:00
Alexander Köplinger e5cf24acde [System.Runtime.Caching] Make some MemoryCache tests more reliable
After MemoryCache was imported from referencesources, some tests started
failing occasionally. Cross-testing on MS.NET showed that you need to
access the cached item to make MemoryCache.GetCount() reliably return the
correct number after an item was expired from the cache.

Also removed __MonoTimerPeriod and __MonoEmulateOneCPU configuration variables,
they were used in Mono code before and don't make sense with the new code.
2015-03-04 13:46:04 -08:00
Zoltan Varga 3cf4d21f8a [bcl] Put the files created by the HostFileChangeMonitor test into an additional subdir to avoid the file system watcher starting to watch system temporary files in the parent dir. Dispose file system watchers at the end of the test. 2015-01-13 18:56:14 -05:00
Marcos Henrich 3bcef7ef86 [System.Runtime.Caching] Updated MemoryCacheTest.
When config PhysicalMemoryLimitPercentage is not set or set to zero MemoryCache.PhysicalMemoryLimit value will depend on the total physical memory available.
2015-01-10 11:30:01 +00:00
Marcos Henrich 5caa7a1491 [System.Runtime.Caching] MemoryCacheTest.Trim now checks LRU.
Entries are now removed in the least recently used order.
MemoryCacheTest.Trim was updated to check that entries are removed in LRU order.
2015-01-09 15:36:57 +00:00
Marcos Henrich 70d30f9de1 [System.Runtime.Caching] Updated MemoryCacheTest.TestCacheSliding.
Changed sliding expiration timeout from 1 second to 2 seconds.
2015-01-09 15:36:57 +00:00
Marcos Henrich 861b335181 [System.Runtime.Caching] Updated tests default PhysicalMemoryLimit.
MemoryCache.PhysicalMemoryLimit default value is now 99 instead of 98.
2015-01-09 15:36:57 +00:00
Alexander Köplinger 98513c62ec [System.Runtime.Caching] Fixed test that failed intermittently on slow systems
Apparently on slow systems the items with 1sec expiration time are already removed from the cache by the time the #CS3 Assert() is hit, which caused the test to fail.
Increasing the expiration time by +2sec should hopefully fix this.

Commit licensed under MIT/X11.
2014-06-19 21:54:02 +02:00
Alexis Christoforides 4c2a8ed3dd Extended test time for timer-sensitive tests. 2014-04-28 16:52:25 -04:00
Craig Minihan 3c759e3969 [Fix] Bugzilla #18213 - System.Runtime.Caching.MemoryCache doesn't honor SlidingExpiration 2014-03-26 17:32:01 -07:00
Craig Minihan 8218c4afa1 [Fix] Bugzilla #18235 - System.Runtime.Caching.MemoryCache doesn't order expirable items correctly
- BubbleUp() in MemoryCacheEntryPriorityQueue was not ordering correctly on item insert
- Added a test case
2014-03-15 13:57:50 -07:00
Craig Minihan d4ea35a94a [Fix] Bugzilla #18245 - System.Runtime.MemoryCache.GetValues() throws LockRecursionException with expired items
- GetValues() calls MemoryCacheContainer.GetEntry() which now gets an EnterUpgradeableReadLock needed by ExpireIfNeeded()
- Added a test case
2014-03-07 04:40:23 -08:00
Craig Minihan 58e399bb9b [Fix] Bugzilla #17897 - MemoryCacheEntryPriorityQueue throws out of bounds after shrink
- when MemoryCacheEntryPriorityQueue grows the timed items after a shrink
  the value of the member variable heapSize is wrong allowing an out-of-
  bounds exception which would normally be prevented by bounds tests
- A test case was added for the out-of-bounds exception
2014-03-06 02:46:49 -08:00
Marek Safar c83e56292d [System.Runtime.Caching] Fix ambiguous method call 2014-02-21 09:27:30 +01:00
Marek Habersack 23691dacd6 [system.runtime.caching] Do not test the invalid behavior 2011-01-04 10:22:22 +01:00
Marek Habersack 920a298158 2010-04-26 Marek Habersack <[email protected]>
* MemoryCacheTest.cs: added tests for LRU removal of entries.

2010-04-26  Marek Habersack  <[email protected]>

	* MemoryCacheLRU.cs: added

	* MemoryCacheContainer.cs: added LRU entry cache.

	* MemoryCache.cs: added option to emulate one CPU on SMP machines
	(for testing purposes) - "__MonoEmulateOneCPU"

svn path=/trunk/mcs/; revision=156125
2010-04-26 19:39:32 +00:00
Marek Habersack 972273ea96 2010-04-24 Marek Habersack <[email protected]>
* MemoryCacheTest.cs, ObjectCacheTest.cs: added

	* HostFileChangeMonitorTest.cs: added more tests.

2010-04-24  Marek Habersack  <[email protected]>

	* AppDomainTools.cs, AssertExtensions.cs, PokerChangeMonitor.cs,
	PokerMemoryCache.cs, PokerObjectCache.cs,
	TestNotificationSystem.cs: added

2010-04-24  Marek Habersack  <[email protected]>

	* ObjectCache.cs: implemented all the non-abstract methods.

	* MemoryCacheContainer.cs, MemoryCacheEntry.cs,
	MemoryCacheEntryChangeMonitor.cs,
	MemoryCacheEntryPriorityQueue.cs,
	MemoryCachePerformanceCounters.cs: added

	* MemoryCache.cs: implemented physical memory size detection, item
	expiration timer, indexer, reading of configuration values from
	config files, cache memory limit calculation, the
	AddOrGetExisting, Set, Get, Contains,
	CreateCacheEntryChangeMonitor, Dispose, GetCacheItem, GetCount,
	GetEnumerator, GetValues, Remove and Trim methods.
	Implemented support for per-cpu item containers.
	Modified parameters of several methods to match .NET 4.0 release.

	* HostFileChangeMonitor.cs: implemented according to tests.

	* Helpers.cs: added new properties, StringComparer and Is64bit

	* FileChangeNotificationSystemEntry.cs: added

	* FileChangeNotificationSystem.cs: implemented

	* ChangeMonitor.cs: NotifyOnChanged now properly throws an
	exception if it was called more than once.

	* CacheEntryRemovedReason.cs: renamed from
	CacheEntryRemoveReason.cs

	* CacheEntryChangeMonitor.cs: renamed from CacheEntryMonitor.cs

2010-04-24  Marek Habersack  <[email protected]>

	* MemoryCacheSettingsCollection.cs: added and implemented methods
	which appeared in .NET 4.0 final.

svn path=/trunk/mcs/; revision=156032
2010-04-23 23:54:57 +00:00
Jb Evain 1cfe332670 fix run-test
svn path=/trunk/mcs/; revision=155051
2010-04-08 14:36:34 +00:00
Marek Habersack 44d44d4be1 Beginnings of System.Runtime.Caching
svn path=/trunk/mcs/; revision=154941
2010-04-07 13:13:03 +00:00